/etc/apt/sources.list
には Debian パッケージを公開しているさまざまなリポジトリが記載されています。APT はそれぞれのソースで公開されているパッケージのリストを取り込みます。具体的に言うと、バイナリパッケージソースの場合は Packages.xz
ファイルまたは Packages.gz
や Packages.bz2
(別の方法で圧縮されたファイル)、ソースパッケージソースの場合は Sources.xz
ファイルまたは別の方法で圧縮されたファイルをダウンロードして、内容を解析して、パッケージのリストを取り込みます。これらのファイルの古いコピーが既にあるのなら、APT は差分だけをダウンロードしてファイルを更新することも可能です (補注「TIP Incremental updates」を参照してください)。
/etc/apt/sources.list
にある有効な行はパッケージのソースで、一行は3つ以上にスペースで区切られています。この書式の解説、利用方法等は sources.list(5) にあります。
例 6.1 /etc/apt/sources.list
の記述例
deb url リリース名 コンポーネント1 コンポーネント2 コンポーネント3 [..] コンポーネントX deb-src url リリース名 コンポーネント1 コンポーネント2 コンポーネント3 [..] コンポーネントX
deb
deb-src
Packages.xz
files, it must give a full and valid URL. This can consist in a Debian mirror or in any other package archive set up by a third party. The URL can start with file://
to indicate a local source installed in the system's file hierarchy, with http://
or https://
to indicate a source accessible from a web server, or with ftp://
or ftps://
for a source available on an FTP server. The URL can also start with cdrom:
for CD-ROM/DVD/Blu-ray disc based installations, although this is less frequent, since network-based installation methods are eventually more common. More methods like ssh://
or tor+http(s)://
are supported and are either described in sources.list(5) or their respective apt-transport-method package documentation.
./
” which refers to the absence of a subdirectory. The packages are then directly at the specified URL. But in the most common case, the repositories will be structured like a Debian mirror, with multiple distributions, each having multiple components. In those cases, name the chosen distribution by its “codename” — see the list in sidebar 「COMMUNITY Bruce Perens、賛否の分かれるリーダー」 — or by the corresponding “suite” (oldoldstable
, oldstable
, stable
, testing
, unstable
) and then the components to enable. A typical Debian mirror provides the components main
, contrib
, and non-free
.
cdrom
エントリはあなたの持っている CD/DVD-ROM を表しています。他のエントリと異なり、CD-ROM は常に利用できるわけではありません。なぜなら、ディスクをドライブに挿入しなければいけませんし、一度に 1 つのディスクしか読めないからです。このような理由で、CD-ROM ソースは少し違う方法で管理されます。ソースを追加するには通常 apt-cdrom
プログラムに add
パラメータを付けて実行します。このようにプログラムを実行すると、ドライブにディスクを挿入するよう要求されます。apt-cdrom
プログラムはディスクの内容を閲覧して Packages
ファイルを探します。Packages
ファイルは利用できるパッケージに関する APT のデータベースを更新するために利用されます (更新作業は apt update
コマンドで実行されます)。そして、APT はディスクに含まれるパッケージが必要になったらディスクを挿入するように要求します。
sources.list
です。
例 6.2 Debian 安定版ユーザ向けの /etc/apt/sources.list
ファイル
# セキュリティ更新 deb http://security.debian.org/ bullseye/updates main contrib non-free deb-src http://security.debian.org/ bullseye/updates main contrib non-free ## Debian ミラー # ベースリポジトリ deb http://deb.debian.org/debian bullseye main contrib non-free deb-src http://deb.debian.org/debian bullseye main contrib non-free # 安定版更新 deb http://deb.debian.org/debian bullseye-updates main contrib non-free deb-src http://deb.debian.org/debian bullseye-updates main contrib non-free # 安定版バックポート deb http://deb.debian.org/debian bullseye-backports main contrib non-free deb-src http://deb.debian.org/debian bullseye-backports main contrib non-free
stable
、stable-updates
、stable-backports
) という別名を使わなかったのには理由があります。それは、新しい安定版が公開されることにより自動的にディストリビューションのバージョンが変わることを避けるためです。
sources.list
ファイルにリストされた最初のリポジトリから取得されることに注意してください。この理由から、非公式ソースは通常最後に追加されます。
security.debian.org
, a small set of machines maintained by the Debian System Administrators. This archive contains security updates prepared by the Debian Security Team and/or by package maintainers for the Stable and Oldstable distribution.
Debian Security Advisory
(DSA) and announces it together with the security update on the debian-security-announce@lists.debian.org
mailing list (archive).
proposed-updates
repository, carefully selected by the Stable Release Managers. All updates are announced on the debian-stable-announce@lists.debian.org
mailing list (archive) and will be included in the next Stable point release anyway.
proposed-updates
リポジトリとは (安定版リリースマネージャの指揮の下で) 今後予定されている更新を準備するためのリポジトリです。
proposed-updates
リポジトリに加えられますが、更新は他にもあります。なぜなら、パッケージメンテナは素早くリリースすることもないけれど重要と思われるバグを修正する機会があるからです。
proposed-updates
リポジトリを使います。以下で引用した例は bullseye-proposed-updates
という別名を使っています。このような、より明白でより一貫性のある別名を使っている理由は、(旧安定版 に対する更新用のリポジトリとして) buster-proposed-updates
という別名が存在するからです。
deb https://deb.debian.org/debian bullseye-proposed-updates main contrib non-free
stable-backports
リポジトリは「パッケージのバックポート」をホストしています。「パッケージのバックポート」という用語は古いディストリビューション (通常は安定版) 用に再コンパイルした最新ソフトウェアのパッケージを指す言葉です。
stable-backports
に収録されているバックポートはテスト版で利用できるパッケージのみから作成されます。このおかげで、次の Debian 安定版リリースが利用できるようになったら、すべてのインストール済みバックポートパッケージはそれに対応する安定版から提供されたパッケージにアップグレードできることが保証されています。
APT
は以下に示すように明確な指示を出さない限り (または以前に同じバックポートの古いバージョンをインストールしていない限り) バックポートパッケージをインストールしません。
$
sudo apt-get install package/bullseye-backports
$
sudo apt-get install -t bullseye-backports package
sources.list
です。
例 6.3 Debian テスト版/不安定版ユーザ向けの /etc/apt/sources.list
ファイル
# 不安定版 deb https://deb.debian.org/debian unstable main contrib non-free deb-src https://deb.debian.org/debian unstable main contrib non-free # テスト版 deb https://deb.debian.org/debian testing main contrib non-free deb-src https://deb.debian.org/debian testing main contrib non-free # テスト版セキュリティ更新 deb http://security.debian.org/ testing-security main contrib non-free deb-src http://security.debian.org/ testing-security main contrib non-free # 安定版 deb https://deb.debian.org/debian stable main contrib non-free deb-src https://deb.debian.org/debian stable main contrib non-free # 安定版セキュリティ更新 deb http://security.debian.org/ stable-security main contrib non-free deb-src http://security.debian.org/ stable-security main contrib non-free
sources.list
file APT will install packages from the Unstable suite. If that is not desired, use the APT::Default-Release
setting (see 第 6.2.3 節「システムのアップグレード」) to instruct APT to pick packages from another suite (most likely Testing in this case).
sources.list
ファイルに追加しても、実験版パッケージを体系的に利用することにはならないからです。実験版リポジトリを追加するには以下を sources.list
ファイルに追加します。
deb https://deb.debian.org/debian experimental main contrib non-free
sources.list
examples in this chapter refer to package repositories hosted on deb.debian.org
. Those URLs will redirect you to servers which are close to you and which are managed by Content Delivery Networks (CDN) whose main role is to store multiple copies of the files across the world, and to deliver them as fast as possible to users. The CDN companies that Debian is working with are Debian partners who are offering their services freely to Debian. While none of those servers are under direct control of Debian, the fact that the whole archive is sealed by GPG signatures makes it a non-issue.
deb.debian.org
の性能に満足できないなら、以下の公式ミラーリストからさらに良いミラーを探してみてください:
ftp.country-code.debian.org
という (例: USA 用に ftp.us.debian.org
、フランス用に ftp.fr.debian.org
など) DNS エントリを整備しています。数多くの国に対するエントリが用意されていますし、その国の中で最良のミラー (複数個の場合もあります) に転送されます。
deb.debian.org
の代替として、過去に httpredir.debian.org
がありました。このサービスはユーザに近いミラーを見極め (主に GeoIP を使って公式ミラーから選び)、APT リクエストをそのミラーに転送するものでした。このサービスは信頼性の懸念が原因で既に停止しており、httpredir.debian.org
では deb.debian.org
と同じ CDN に基づくサービスが提供されています。
mentors.debian.net
site is interesting (although it only provides source packages), since it gathers packages created by candidates to the status of official Debian developer or by volunteers who wish to create Debian packages without going through that process of integration. These packages are made available without any guarantee regarding their quality; make sure that you check their origin and integrity and then test them before you consider using them in production.
sources.list
を変更する必要はありませんが、APT の外部リクエスト用のプロキシ設定をこれらのプロキシキャッシュサーバに変更する必要があります。
/etc/approx/approx.conf
に保存されています。
# <最上位ディレクトリの名前> <リモート側リポジトリの基点 URL> debian https://deb.debian.org/debian security http://security.debian.org/debian-security
sources.list
ファイルを書き換えなければいけません。
# ローカル approx サーバを利用する設定を施した sources.list の見本 deb http://localhost:9999/security bullseye-secutiry main contrib non-free deb http://localhost:9999/debian bullseye main contrib non-free