apt.conf.d
Ubuntu의 /etc/apt/apt.conf.d/ 는 APT 설정 조각(fragment)을 숫자 순서대로 읽어 합치는 디렉터리다. 동일한 Ubuntu 계열이라도 설치된 패키지에 따라 파일 목록이 달라질 수 있다.
Summary
apt.conf단일 파일 대신 작은 조각 파일 여러 개로 APT 동작을 나눈다.- 파일명 앞 숫자가 낮을수록 먼저 적용되고, 뒤쪽 파일이 hook이나 값을 추가하거나 덮어쓸 수 있다.
- Ubuntu 24.04
noble패키지 기준으로 자주 보이는 기본 조각들을 정리했다.
Order
01*: 배포판 기본 정책과 자동 제거 보호 규칙20*: 외부 연동 hook 또는 캐시 보존 정책50*: AppStream 같은 metadata 인덱스 확장70*:debconf사전 설정 hook99*: update notifier, needrestart 같은 후처리 hook
설정이 실제로 어떻게 합쳐졌는지 보고 싶으면
apt-config dump 를 사용한다. 특정 파일 하나만 보고 판단하면 최종 동작을 놓칠 수 있다.
Common Files
| 파일 | 역할 | 소유 패키지 |
|---|---|---|
| 01-vendor-ubuntu | Ubuntu vendor 기본값과 changelog 관련 네트워크 동작 | apt |
| 01autoremove | kernel, firmware, metapackage 자동 제거 보호 규칙 | apt |
| 20apt-esm-hook.conf | Ubuntu Pro / ESM 관련 캐시와 upgrade hook | ubuntu-pro-client |
| 20archive | /var/cache/apt/archives 보관 기간과 크기 제한 | update-notifier-common |
| 20packagekit | PackageKit에 cache 변경 신호 전송 | packagekit |
| 50appstream | DEP-11 metadata 와 GUI icon index 다운로드 정의 | appstream |
| 70debconf | 패키지 설치 전 debconf preconfigure 실행 | debconf |
| 99needrestart | library update 뒤 재시작이 필요한 서비스 점검 | needrestart |
| 99update-notifier | MOTD update 정보와 notifier stamp 갱신 | update-notifier-common |
Troubleshooting
- hook 실행 오류가 나면 먼저 어느 파일이
Pre-Invoke,Post-Invoke를 등록했는지 이 디렉터리에서 확인한다. apt update가 느려졌다면50appstream의 metadata 추가 다운로드 여부를 점검한다.- 서버 이미지에서 GUI 관련 동작이 불필요하면
20packagekit나50appstream이 실제 설치되어 있는지부터 확인한다. - 자동 제거가 과하게 일어나는 것처럼 보이면
01autoremove와apt-mark manual상태를 함께 본다.
See Also
History
- codex:: 2026-07-13 Added an Ubuntu apt.conf.d index with common default fragments and package ownership notes.