[linux] apt 저장소 변경하기 (sources.list 변경)

패키지 관리자(apt) 저장소 정보(서버)를 변경하기!

APT는 패키지를 설치하거나 업그레이드할 때 패키지가 어디에서 다운로드되어야 하는지를 지정하는 저장소 정보를 담고 있는 설정 파일(/etc/apt/sources.list)을 사용.

 

변경하기

debian 12(bookworm)에서 실행.

vi /etc/apt/sources.list

다음과 같이 내용을 수정. 저장소 정보를 변경하는 것이다.

쉽게 말하면 apt 패키지의 서버를 변경해 어디서 패키지를 다운로드할지 설정하는 것이다.

저장소에 따라 패키지의 내용이 다를 수 있기에 만약 패키지 설치가 정상적으로 동작하지 않는다면 이 정보를 변경해 보는 것도 괜찮은 시도이다.

 

저장소 정보는 검색하면 대부분 나오지만 debian과 ubuntu의 정보는 남겨둬야지.

debian 12 (Bookworm)

deb http://deb.debian.org/debian bookworm main
deb-src http://deb.debian.org/debian bookworm main

deb http://deb.debian.org/debian-security/ bookworm-security main
deb-src http://deb.debian.org/debian-security/ bookworm-security main

deb http://deb.debian.org/debian bookworm-updates main
deb-src http://deb.debian.org/debian bookworm-updates main

Ubuntu 20.04 LTS (Focal Fossa)

deb http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse

deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse

deb http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse

deb http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse

deb http://archive.canonical.com/ubuntu focal partner
deb-src http://archive.canonical.com/ubuntu focal partner

Ubuntu 22.04 LTS (Jammy Jellyfish)

deb http://archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse

deb http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe multiverse

deb http://archive.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse

deb http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse

deb http://archive.canonical.com/ubuntu/ jammy partner
deb-src http://archive.canonical.com/ubuntu/ jammy partner