/etc/apt/sources.list
,列出 Debian 套件的典藏所 (或 “來源”)。APT 將匯入各來源節套件清單。下載 Packages.xz
或以不同的壓縮方法 (如 Packages.gz
或 .bz2
) 檔案 (使用執行套件時) 與 Sources.xz
或其他 (使用原始套件時) 然後分析其內容,就能完成該作用。已安裝舊版時,APT 可下載其差異更新之 (見專欄 秘訣 增量式升級)。
/etc/apt/sources.list
內的每列就是一個來源,包括三個以空格區隔的部份。
deb
” 表示為執行套件,
deb-src
” 表示來源套件。
Packages.gz
內的檔名,必須給全名與有效的 URL):可以是 Debian 鏡射站或第三方的任何套件檔案。URL 可以使用 file://
表示從在地的資料夾內讀取,以 http://
表示來自網站的來源,或以 ftp://
表示取自 FTP 伺服器的來源。雖然很少發生,但URL 也可以使用 cdrom:
表示為 CD-ROM/DVD-ROM/Blu-ray 磁碟式安裝,大部份情況下都是網路安裝。
./
” 標示無次資料夾 — 套件就在指定的 URL 內) 的次資料夾 (含結尾的斜線)。比較常見的狀況是,像 Debian 鏡射站的典藏所,每個發行版有自己的元件。在這些情況下,選定發行版 (以 “代碼” 指名 — 見專欄 社群 布魯斯·佩倫斯,另類的領導者 — 或對應的 “組” — 穩定
、測試
、不穩定
),啟用 (選擇 Debian 鏡射的 main
、contrib
、與 non-free
) 組成元件 (或區)。
cdrom
條目表示您有此 CD/DVD-ROMs。相對於其他條目,CD-ROM 並非經常存在,一次祗能塞入一張。基於這個理由,以不同的方式管理此來源,需用到 apt-cdrom
程式,及 add
參數。要求將光碟插入光碟機,並找尋 套件
檔案。以此等檔案更新可用套件的資料庫 (通常以 apt update
命令完成它)。然後,APT 才能要求插入包括其套件的光碟。
sources.list
供系統執行 穩定 版 Debian:
範例 6.1. 供 Debian 穩定版使用者的 /etc/apt/sources.list
# Security updates deb http://security.debian.org/ jessie/updates main contrib non-free deb-src http://security.debian.org/ jessie/updates main contrib non-free ## Debian mirror # Base repository deb http://ftp.debian.org/debian jessie main contrib non-free deb-src http://ftp.debian.org/debian jessie main contrib non-free # Stable updates deb http://ftp.debian.org/debian jessie-updates main contrib non-free deb-src http://ftp.debian.org/debian jessie-updates main contrib non-free # Stable backports deb http://ftp.debian.org/debian jessie-backports main contrib non-free deb-src http://ftp.debian.org/debian jessie-backports main contrib non-free
穩定
、穩定更新
、穩定-反向
),因為下個穩定版釋出時,不要讓他們不受控制。
sources.list
檔案前面的典藏庫。所以,非官方的來源多半放在此檔案的最後面。
security.debian.org
(在 Debian 系統管理者 維護的小機器內)。包括給 穩定版 使用的安全更新檔案 (由 Debian 安全團隊與套件管理者共同準備)。
建議更新
典藏庫的子集合。
建議的更新
典藏庫是儲放更新資料的地方 (由穩定版釋出經理管轄)。
jessie-proposed-updates
取用更明確與一致的資料,因為 wheezy-proposed-updates
也擁有相同的容 (供 Oldstable 更新使用):
deb http://ftp.debian.org/debian jessie-proposed-updates main contrib non-free
穩定回移
典藏庫儲存 “回移的套件”。係指重新編譯供舊發行版使用的套件,通常係供 h穩定版 使用。
穩定回移
典藏庫。但 Squeeze 的回移仍典藏藏在指定的伺服器 (backports.debian.org
),且要求使用 sources.list
的條目才能取用:
deb http://backports.debian.org/debian-backports squeeze-backports main contrib non-free
穩定回移
的回移總是取材自 測試版 的套件。才能確保所有安裝的回移可順利地升級至下個 Debian 穩定版。
$
sudo apt-get install 套件/jessie-backports
$
sudo apt-get install -t jessie-backports 套件
sources.list
供執行 Debian 測試版 或 不穩定版 之用:
範例 6.2. /etc/apt/sources.list
檔案供 Debian 測試版/不穩定版 使用者
# Unstable deb http://ftp.debian.org/debian unstable main contrib non-free deb-src http://ftp.debian.org/debian unstable main contrib non-free # Testing deb http://ftp.debian.org/debian testing main contrib non-free deb-src http://ftp.debian.org/debian testing main contrib non-free # Stable deb http://ftp.debian.org/debian stable main contrib non-free deb-src http://ftp.debian.org/debian stable main contrib non-free # Security updates deb http://security.debian.org/ stable/updates main contrib non-free deb http://security.debian.org/ testing/updates main contrib non-free deb-src http://security.debian.org/ stable/updates main contrib non-free deb-src http://security.debian.org/ testing/updates main contrib non-free
sources.list
檔案安裝來自 不穩定版 的套件。若非必要,則使用 APT::Default-Release
設定 (見 節 6.2.3, “系統升級”) 指示 APT 從另個版本 (多半使用 測試版) 選取套件。
sources.list
內,並不表示該套件可順利使用,應加入這一個行:
deb http://ftp.debian.org/debian experimental main contrib non-free
mentors.debian.net
網站很有趣 (雖然它祗提供原始套件),因為它它的套件係供 Debian 官方發展者檢視或由志願者提供未經整合程序的套件。這些不保證品質的套件,允許並鼓勵使用者在正式使用之前,檢查並測試之。
sources.list
不變,但 APT 組態成像是快取。
/etc/approx/approx.conf
:
# <name> <repository-base-url> debian http://ftp.debian.org/debian security http://security.debian.org
inetd
Super-Server”) 在埠號 9999 執行,並且要求使用者調整其 sources.list
檔案指向 approx 伺服器:
# Sample sources.list pointing to a local approx server deb http://apt.falcot.com:9999/security jessie/updates main contrib non-free deb http://apt.falcot.com:9999/debian jessie main contrib non-free