sudo apt-get update 에러

sudo apt-get update를 시행하면 완료가 되지 않고 계속해서 오류 발생.

1.  이걸 해도 안된다.

$sudo rm -rf /var/lib/apt/lists/* -vf
$sudo apt-get update

 

  1. mirror 수정

업데이트 서버 변경(패키지 다운로드 서버가 변경되어서 403이나 404에러가 발생한 것일 수도 있다)

현재 kr.archive.ubuntu.com 서버를 사용할 경우

$cd /etc/apt
$sudo sed -i 's,http://.*ubuntu.com,http://old-releases.ubuntu.com,g' sources.list
$sudo apt-get update

안된다.

 

  1. 서버 변경
$cd /etc/apt
$sudo vi /etc/apt/sources.list
/%s/kr.archieve.ubuntu.com/ftp.daum.net

archieve.ubuntu.com 홈페이지에서 ftp.daum.net 홈페이지로 변경됨
하지만 그래도 안됨.

 

  1. 정리하고 다시
$sudo dpkg --clear-avail
$sudo dpkg --configure -a
$sudo apt-get clean
$sudo apt-get update

그래도 안됨..

 

[완료] 다시 정리

**오류 코드

W: Target Sources (main/source/Sources) is configured multiple times 
in /etc/apt/sources.list.d/webupd8team-ubuntu-java-xenial.list:2 and 
/etc/apt/sources.list.d/webupd8team-ubuntu-java-xenial.list:7

multiple times 오류발생.
sources.list.d 에 저장된 저장소에서 중복이 발생하여 생긴 일이다.

 

해결 방법은

$grep -v '#' sources.list
deb http://archive.ubuntu.com/ubuntu xenial main restricted
deb http://archive.ubuntu.com/ubuntu xenial-updates main restricted
deb http://archive.ubuntu.com/ubuntu xenial universe
deb http://archive.ubuntu.com/ubuntu xenial-updates universe
deb http://archive.ubuntu.com/ubuntu xenial multiverse
deb http://archive.ubuntu.com/ubuntu xenial-updates multiverse
deb http://archive.ubuntu.com/ubuntu xenial-backports main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu xenial-security main restricted
deb http://archive.ubuntu.com/ubuntu xenial-security universe
deb http://archive.ubuntu.com/ubuntu xenial-security multiverse
deb http://archive.canonical.com/ubuntu xenial partner

sources.list 확인

$lsb_release -a
No LSB modules are available.
Distributor ID:    Ubuntu
Description:    Ubuntu 16.04 LTS
Release:    16.04
Codename:    xenial

우분투 버전확인

 

$cd /etc/apt/sources.list.d/
$ls
pmjdebruijn-ubuntu-darktable-release-xenial.list
pmjdebruijn-ubuntu-darktable-release-xenial.list.save
ravefinity-project-ubuntu-ppa-xenial.list
ravefinity-project-ubuntu-ppa-xenial.list.save
storm-ubuntu-ppa-xenial.list
storm-ubuntu-ppa-xenial.list.save
webupd8team-ubuntu-java-xenial.list
webupd8team-ubuntu-java-xenial.list.save
xenial-partner.list
xenial-partner.list.save

sources.list.d 목록 확인

 

$sudo vi /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu xenial main restricted
deb http://archive.ubuntu.com/ubuntu xenial-updates main restricted
deb http://archive.ubuntu.com/ubuntu xenial universe
deb http://archive.ubuntu.com/ubuntu xenial-updates universe
deb http://archive.ubuntu.com/ubuntu xenial multiverse
deb http://archive.ubuntu.com/ubuntu xenial-updates multiverse
deb http://archive.ubuntu.com/ubuntu xenial-backports main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu xenial-security main restricted
deb http://archive.ubuntu.com/ubuntu xenial-security universe
deb http://archive.ubuntu.com/ubuntu xenial-security multiverse

사전에 백업해둔 파일의 내용을 붙여놓기

 

$sudo rm *

sources.list.d 목록 삭제
충돌이 발생해서 지금까지 문제가 발생하였기에 삭제한다.

 

$sudo apt clean
$sudo apt update
기존:1 http://archive.ubuntu.com/ubuntu xenial InRelease
기존:2 http://archive.ubuntu.com/ubuntu xenial-updates InRelease  
기존:3 http://archive.ubuntu.com/ubuntu xenial-backports InRelease 
기존:4 http://archive.ubuntu.com/ubuntu xenial-security InRelease  
패키지 목록을 읽는 중입니다... 완료     
의존성 트리를 만드는 중입니다       
상태 정보를 읽는 중입니다... 완료
5 packages can be upgraded. Run 'apt list --upgradable' to see them.


$sudo apt list --upgradable
$sudo apt-get update
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s