본문 바로가기
리눅스

Debian SourcesList

by 다움위키 2025. 2. 4.

원문 보기: https://dawoum.duckdns.org/wiki/Debian/SourcesList

 

Original article: debian:SourcesList

데비안 패키지는 저장소에 보관되어 있습니다. 데비안 저장소는 전전안정, 전안정, 안정, 테스팅, 불안정, 실험으로 나누어 저장됩니다.

데비안에서 프로그램을 설치하기 위해, 저장소에서 프로그램의 목록을 얻고, 그 이후에 작업이 진행되어야 합니다.

이 목록을 얻어오는 과정의 안전을 위해, gpg 키로 신뢰할 수 있는 연결을 만듭니다.

이전에는 sources.list와 sources.list.d/ 디렉토리 아래에 저장소 위치를 적고, /etc/apt/trusted.gpg.d 디렉토리 아래에 저장소에서 발행한 공개키를 저장해서 과정을 진행했습니다.

한편, apt (2.9.24)로 업데이트되면서 아래와 같은 메시지를 받을 수 있습니다:

apt (2.9.24) unstable; urgency=medium

  /etc/apt/trusted.gpg is no longer trusted. Setting the Dir::Etc::trusted
  option manually continues to work for some more time.

  sources.list(5) entries without the Signed-By field are deprecated;
  migrate any legacy entries to the deb822 .sources format. See the
  apt-secure(8) manual page for best practices for signer configuration.
  This deprecates the /etc/apt/trusted.gpg.d directory.

 -- Julian Andres Klode <jak@debian.org>  Tue, 21 Jan 2025 12:17:36 +0100

앞으로 곧 이전 형식은 사용할 수 없을 것이고 새로운 deb822 .sources 형식으로 전환해야 한다는 내용입니다.

Example debian.sources

데비안 12 안정판의 저장소는 이전 형식에서 /etc/apt/sources.list에 다음과 같이 기록됩니다:

deb https://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
deb-src https://deb.debian.org/debian bookworm main contrib non-free non-free-firmware

deb https://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
deb-src https://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware

deb https://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware
deb-src https://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware

위와 같은 같은 내용을 새로운 deb822로 바꿀 때에는 /etc/apt/sources.list.d/debian.sources에 다음과 같이 기록할 수 있습니다:

Types: deb deb-src
URIs: https://deb.debian.org/debian
Suites: bookworm bookworm-updates
Components: main contrib non-free non-free-firmware
Enabled: yes
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

Types: deb deb-src
URIs: https://security.debian.org/debian-security
Suites: bookworm-security
Components: main contrib non-free non-free-firmware
Enabled: yes
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

만약 bookworm-backports가 필요하다면, 저장소 이름, bookworm-backports를 Suites 맨 끝에 추가함으로써 해결될 수 있습니다.

Summary

  • /etc/apt/sources.list는 사용하지 말고, /etc/apt/sources.list.d/debian.sources와 같이 사용해야 합니다. 다른 저장소, mozilla, winehq 등도, 예를 들어, mozilla.sources, winehq.sources와 같은 이름으로 deb822 형식으로 만들 수 있습니다.
  • /etc/apt/trusted.gpg 및 /etc/apt/trusted.d/ 디렉토리는 사용하지 말고, /usr/share/keyrings/ 디렉토리 아래에 gpg 파일을 저장하고, .sources 파일에서 Signed-By: 로 gpg 파일의 절대 경로를 쓸 수 있습니다.