Skip to content

deb822 소스 형식(.sources)

Debian 12부터 도입되어 Debian 13 (Trixie) 에서 기본값이 된 deb822 형식은 더 명확하고 유지 관리가 쉬운 소프트웨어 저장소 구성 방식입니다. .sources 확장자를 사용하며, 각 저장소는 여러 줄의 '키: 값' 형식으로 설명되어 기존의 한 줄 deb 표기법을 대체합니다.

기존 형식 vs deb822 형식

기존 한 줄 형식(/etc/apt/sources.list):

deb http://deb.debian.org/debian trixie main contrib non-free non-free-firmware
deb http://security.debian.org/debian-security trixie-security main contrib non-free non-free-firmware
deb http://deb.debian.org/debian trixie-updates main contrib non-free non-free-firmware

deb822 형식(/etc/apt/sources.list.d/debian.sources):

text
Types: deb
URIs: http://deb.debian.org/debian
Suites: trixie trixie-updates
Components: main contrib non-free non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

Types: deb
URIs: http://security.debian.org/debian-security
Suites: trixie-security
Components: main contrib non-free non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

Debian 13을 새로 설치하면 공식 저장소는 /etc/apt/sources.list.d/debian.sources에 저장되며, 기존의 /etc/apt/sources.list는 일반적으로 비어 있거나 존재하지 않습니다.

필드 설명

필드설명
Types저장소 유형. deb는 바이너리 패키지, deb-src는 소스 패키지를 나타냅니다. 공백으로 구분하여 여러 개를 쓸 수 있습니다.
URIs미러 주소. 여러 주소를 써서 미러 중복을 구현할 수 있습니다.
Suites배포판/수트. 예: trixie, trixie-updates, trixie-backports. 여러 개를 쓸 수 있습니다.
Components구성 요소. main(자유 소프트웨어), contrib, non-free, non-free-firmware(비자유 펌웨어).
Signed-By해당 저장소를 검증하는 GPG 공개 키(keyring) 경로. 항상 명시적으로 지정하는 것을 권장하며, 전역적으로 신뢰하는 apt-key 사용을 피합니다.
Enabled선택 사항. no로 설정하면 저장소를 삭제하지 않고 일시적으로 비활성화할 수 있습니다.
Architectures선택 사항. 아키텍처 제한. 예: amd64, arm64.

하나의 .sources 파일에는 여러 저장소 항목을 포함할 수 있으며, 항목 사이는 빈 줄 하나로 구분합니다.

원클릭 마이그레이션: apt modernize-sources

Debian 13에 포함된 APT 3.0은 기존 한 줄 형식을 자동으로 deb822로 변환하는 공식 마이그레이션 명령을 제공합니다:

bash
sudo apt modernize-sources

이 명령은 기존 sources.list를 읽어 동등한 .sources 파일을 생성하고, 원본 파일을 .bak으로 백업합니다. 실행 후 sudo apt update를 실행하여 확인하십시오.

타사 저장소 추가(deb822 방식)

예를 들어 특정 타사 저장소를 추가해 보겠습니다. 첫 번째 단계로 GPG 공개 키를 다운로드하여 키링으로 변환합니다(더 이상 사용되지 않는 apt-key 사용 금지):

bash
sudo mkdir -p /etc/apt/keyrings
wget -qO - https://example.com/key.gpg | sudo gpg --dearmor -o /etc/apt/keyrings/example.gpg

두 번째 단계.sources 파일을 생성하고 Signed-By로 해당 키링을 참조합니다:

bash
sudo tee /etc/apt/sources.list.d/example.sources > /dev/null <<'EOF'
Types: deb
URIs: https://example.com/debian
Suites: stable
Components: main
Signed-By: /etc/apt/keyrings/example.gpg
Architectures: amd64
EOF

sudo apt update

Signed-By는 이 공개 키를 오직 이 저장소 하나에만 바인딩하므로, 기존의 전역 apt-key보다 훨씬 안전합니다. 타사 저장소가 손상되더라도 해당 키로 공식 저장소의 패키지를 위조할 수 없습니다.

국내 미러 사용

공식 debian.sourcesURIs를 국내 미러로 변경하면 됩니다. 예를 들어 칭화대학교 미러:

text
Types: deb
URIs: https://mirrors.tuna.tsinghua.edu.cn/debian
Suites: trixie trixie-updates trixie-backports
Components: main contrib non-free non-free-firmware
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

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

변경 후 반드시 sudo apt update를 실행하십시오.

요약

  • Debian 13은 기본적으로 deb822(.sources) 형식을 사용하며, 소스 파일은 /etc/apt/sources.list.d/에 위치합니다.
  • sudo apt modernize-sources 명령으로 기존 형식에서 원클릭 마이그레이션할 수 있습니다.
  • 타사 저장소를 추가할 때는 항상 gpg --dearmor로 키링을 생성하고 Signed-By에서 명시적으로 참조하며, apt-key는 더 이상 사용하지 마십시오.

참고 자료: APT 패키지 관리 · Backports 사용 가이드