/etc/apt/sources.list
will list the different repositories (or “sources”) that publish Debian packages. APT will then import the list of packages published by each of these sources. This operation is achieved by downloading Packages.xz
or a variant using a different compression method (such as Packages.gz
or .bz2
) files (in case of a source of binary packages) and Sources.xz
or a variant (in case of a source of source packages) and by analyzing their contents. When an old copy of these files is already present, APT can update it by only downloading the differences (see sidebar تلميح التحديث التصاعدي).
/etc/apt/sources.list
على وصف لمصدر حزم واحد، يتألف من 3 أجزاء تفصلها مسافات.
deb
“ للحزم الثنائية،
deb-src
“ للحزم المصدرية.
Packages.gz
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://
to indicate a source accessible from a web server, or with ftp://
for a source available on an FTP server. The URL can also start with cdrom:
for CD-ROM/DVD-ROM/Blu-ray disc based installations, although this is less frequent, since network-based installation methods are more and more common.
./
“ للدلالة على عدم وجود مجلد فرعي – أي أن الحزم متوفرة مباشرة على العنوان المحدد). لكن على الأرجح، ستكون بنية المستودع كبنية مرآة دبيان، حيث يحوي عدة توزيعات كل منها تحوي عدة مكونات. في هذه الحالات، عليك إضافة اسم التوزيعة المختارة (اسمها ”الرمزي“ —انظر القائمة في الملاحظة الجانبية مجتمع بروس بيرنز، قائد مثير للجدل— أو اسم ”الفرع suite“ الموافق: stable
، testing
، unstable
)، بعدها ضع أسماء المكونات (أو الأقسام) التي تريد تفعيلها (إما main
أو contrib
أو non-free
في مرايا دبيان النموذجية).
cdrom
entries describe the CD/DVD-ROMs you have. Contrary to other entries, a CD-ROM is not always available since it has to be inserted into the drive and since only one disc can be read at a time. For those reasons, these sources are managed in a slightly different way, and need to be added with the apt-cdrom
program, usually executed with the add
parameter. The latter will then request the disc to be inserted in the drive and will browse its contents looking for Packages
files. It will use these files to update its database of available packages (this operation is usually done by the apt update
command). From then on, APT can require the disc to be inserted if it needs one of its packages.
sources.list
قياسي لنظام يعمل بالنسخة المستقرة من دبيان:
مثال 6.1. ملف /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
stable
, stable-updates
, stable-backports
) because we don't want to have the underlying distribution changed outside of our control when the next stable release comes out.
sources.list
. لذلك تضاف المصادر غير الرسمية عادة إلى نهاية الملف.
security.debian.org
(على مجموعة صغيرة من الأجهزة يشرف عليها Debian System Administrators) بدلاً من استضافتها على شبكة مرايا دبيان العادية. يحتوي هذا الأرشيف على التحديثات الأمنية (التي يجهزها Debian Security Team وربما مشرفو الحزم أيضاً) للتوزيعة المستقرة.
proposed-updates
، ينتقيه مديرو الإصدارة المستقرة بعناية.
proposed-updates
هو المكان الذي يتم فيه تحضير التحديثات المنتظرة (تحت إشراف مديري الإصدارة المستقرة).
jessie-proposed-updates
alias which is both more explicit and more consistent since wheezy-proposed-updates
also exists (for the Oldstable updates):
deb http://ftp.debian.org/debian jessie-proposed-updates main contrib non-free
stable-backports
”الحزم المنقولة خلفاً package backports“. يشير هذا المصطلح إلى حزم لبرمجيات حديثة أعيدت ترجمتها لتوزيعة قديمة (نقلت إلى الخلف)، وعادة ما يكون النقل إلى التوزيعة المستقرة.
stable-backports
الآن متوفراً على المرايا العادية لدبيان. لكن المنقولات الخلفية لنسخة سكويز لا تزال مستضافة على مخدم خاص (backports.debian.org
)، وتحتاج المدخلة التالية في ملف sources.list
:
deb http://backports.debian.org/debian-backports squeeze-backports main contrib non-free
stable-backports
دائماً من الحزم المتوفرة في الاختبارية. يضمن هذا الإجراء قابلية تحديث جميع المنقولات الخلفية المُثبَّتَة إلى النسخ المستقرة الموافقة لها فور إطلاق الإصدارة المستقرة التالية من دبيان.
$
sudo apt-get install package/jessie-backports
$
sudo apt-get install -t jessie-backports package
sources.list
قياسي لنظام يعمل بالنسخة الاختبارية أو غير المستقرة من دبيان:
مثال 6.2. ملف /etc/apt/sources.list
لمستخدمي دبيان الاختبارية/غير المستقرة
# 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
APT::Default-Release
(انظر قسم 6.2.3, “تحديث النظام”) لإرشاد APT إلى توزيعة أخرى لالتقاط الحزم منها (ستكون الاختبارية على الأغلب في هذه الحالة).
sources.list
لا تؤدي إلى استخدام حزمها آلياً. السطر الذي تجب إضافته هو:
deb http://ftp.debian.org/debian experimental main contrib non-free
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
:
# <name> <repository-base-url> debian http://ftp.debian.org/debian security http://security.debian.org
inetd
”) ويتطلب من المستخدم تعديل ملف 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