Daftar Isi
apt
vs. apt-get
/
apt-cache
vs. aptitude
testing
with some packages from
unstable
unstable
with some packages from
experimental
![]() |
Catatan |
---|---|
Bab ini ditulis dengan asumsi rilis stabil terbaru adalah nama kode:
|
Debian adalah organisasi sukarelawan yang membangun distribusi yang konsisten dari paket biner perangkat lunak bebas yang diprakompilasi dan mendistribusikan mereka dari arsipnya.
Arsip Debian ditawarkan oleh banyak situs cermin jarak jauh untuk akses melalui metode HTTP dan FTP. Ini juga tersedia sebagai CD-ROM/DVD.
Sistem manajemen paket Debian saat ini yang dapat memanfaatkan semua sumber daya ini adalah Advanced Packaging Tool (APT).
Sistem manajemen paket Debian, bila digunakan dengan benar, menawarkan pengguna untuk memasang set paket biner yang konsisten ke sistem dari arsip. Saat ini, ada 65411 paket yang tersedia untuk arsitektur amd64.
Sistem manajemen paket Debian memiliki sejarah yang kaya dan banyak pilihan untuk front end program pengguna dan metode akses arsip back end yang akan digunakan. Saat ini, kami merekomendasikan hal-hal berikut.
apt
(8) untuk semua operasi baris perintah interaktif,
termasuk instalasi paket, penghapusan, dan dist-upgrade.
apt-get
(8) untuk memanggil sistem manajemen paket Debian
dari skrip. Ini juga merupakan pilihan fallback ketika
apt
tidak tersedia (sering dengan sistem Debian yang
lebih tua).
aptitude
(8) bagi antarmuka teks interaktif untuk
mengelola paket yang dipasang dan untuk mencari paket yang tersedia.
Tabel 2.1. Daftar alat manajemen paket Debian
paket | popcon | ukuran | deskripsi |
---|---|---|---|
dpkg
|
V:923, I:999 | 6874 | sistem manajemen paket tingkat rendah untuk Debian (berbasis berkas) |
apt
|
V:870, I:999 | 4358 | Front-end APT untuk mengelola paket dengan CLI:
apt /apt-get /apt-cache |
aptitude
|
V:68, I:371 | 4256 | Front-end APT untuk mengelola paket secara interaktif dengan konsol layar
penuh: aptitude (8) |
tasksel
|
V:34, I:978 | 395 | Front-end APT untuk memasang tugas yang dipilih:
tasksel (8) |
unattended-upgrades
|
V:313, I:464 | 326 | paket peningkatan bagi APT untuk mengaktifkan instalasi otomatis peningkatan keamanan |
gnome-software
|
V:129, I:229 | 2846 | Pusat Perangkat Lunak untuk GNOME (front-end APT GUI) |
synaptic
|
V:46, I:353 | 7874 | manajer paket grafis (front-end APT GTK) |
apt-utils
|
V:375, I:997 | 1166 | Program utilitas APT: apt-extracttemplates (1),
apt-ftparchive (1), dan apt-sortpkgs (1) |
apt-listchanges
|
V:356, I:856 | 423 | alat pemberitahuan riwayat perubahan paket |
apt-listbugs
|
V:7, I:11 | 465 | menampilkan daftar bug kritis sebelum setiap instalasi APT |
apt-file
|
V:17, I:76 | 90 | Utilitas pencarian paket APT — antarmuka baris perintah |
apt-rdepends
|
V:0, I:6 | 41 | mencantumkan dependensi paket secara rekursif |
Berikut adalah beberapa poin penting untuk konfigurasi paket pada sistem Debian.
Konfigurasi manual oleh administrator sistem dihormati. Dengan kata lain, sistem konfigurasi paket tidak membuat konfigurasi yang mengganggu demi kenyamanan.
Setiap paket dilengkapi dengan skrip konfigurasi sendiri dengan antarmuka
pengguna standar yang disebut debconf
(7) untuk membantu
proses instalasi awal paket.
Para Pengembang Debian mencoba yang terbaik untuk membuat pengalaman peningkatan Anda sempurna dengan skrip konfigurasi paket.
Fungsionalitas penuh perangkat lunak yang dikemas tersedia untuk administrator sistem. Tetapi yang memiliki risiko keamanan dinonaktifkan dalam instalasi baku.
Jika Anda mengaktifkan layanan secara manual dengan beberapa risiko keamanan, Anda bertanggung jawab atas pengurungan (containment) risiko.
Konfigurasi esoterik dapat diaktifkan secara manual oleh administrator sistem. Hal ini dapat membuat gangguan dengan program pembantu generik populer untuk konfigurasi sistem.
![]() |
Awas |
---|---|
Jangan menginstal paket dari campuran acak keluarga. Ini mungkin merusak konsistensi paket yang membutuhkan pengetahuan manajemen sistem yang mendalam, seperti ABI kompiler, versi pustaka, fitur interpreter, dll. |
Administrator sistem Debian pemula harus tetap
memakai rilis Debian stable
sambil hanya menerapkan
pembaruan keamanan. Maksud saya bahwa beberapa tindakan valid berikut lebih
baik dihindari, sebagai tindakan pencegahan, sampai Anda memahami sistem
Debian dengan sangat baik. Berikut adalah beberapa pengingat.
Jangan sertakan testing
atau unstable
dalam
"/etc/apt/sources.list
".
Jangan mencampur Debian standar dengan arsip non-Debian lainnya seperti
Ubuntu di "/etc/apt/sources.list
".
Jangan membuat "/etc/apt/preferences
".
Jangan mengubah perilaku baku alat manajemen paket melalui berkas konfigurasi tanpa mengetahui dampak penuhnya.
Jangan memasang paket acak dengan "dpkg -i
paket_acak
".
Jangan pernah memasang paket acak dengan "dpkg --force-all -i
random_package
".
Jangan menghapus atau mengubah berkas di
"/var/lib/dpkg/
".
Jangan menimpa sistem berkas dengan memasang program perangkat lunak yang langsung dikompilasi dari sumber.
Pasang mereka ke dalam "/usr/local
" atau
"opt
", jika diperlukan.
Efek yang tidak kompatibel yang disebabkan oleh tindakan di atas ke sistem manajemen paket Debian dapat membuat sistem Anda tidak dapat digunakan.
Administrator sistem Debian yang serius yang menjalankan server-server dengan misi penting, harus menerapkan tindakan pencegahan ekstra.
Jangan memasang paket apa pun termasuk pembaruan keamanan dari Debian tanpa mengujinya secara menyeluruh dengan konfigurasi khusus Anda dalam kondisi aman.
Anda sebagai administrator sistem bertanggung jawab atas sistem Anda pada akhirnya.
Sejarah stabilitas panjang sistem Debian bukanlah jaminan dengan sendirinya.
![]() |
Perhatian |
---|---|
Untuk server produksi Anda, disarankan
keluarga |
Terlepas dari peringatan saya di atas, saya tahu banyak pembaca dokumen ini
mungkin ingin menjalankan keluarga testing
atau
unstable
yang lebih baru.
Enlightenment dengan yang berikut menyelamatkan seseorang dari perjuangan karma abadi atas neraka peningkatan dan membiarkan dia mencapai sorga Debian.
Daftar ini ditargetkan untuk lingkungan Desktop yang dikelola sendiri.
Gunakan keluarga testing
karena praktis itu adalah rilis
bergulir yang secara otomatis dikelola oleh infrastruktur QA arsip Debian
seperti integrasi berkelanjutan
Debian, praktik hanya
mengunggah sumber, dan pelacakan transisi pustaka.
Paket-paket di keluarga testing
diperbarui cukup sering
untuk menawarkan semua fitur terbaru.
Atur nama kode yang sesuai dengan keluarga testing
(saat
ini "bookworm
") dalam
"/etc/apt/sources.list
".
Perbarui nama kode ini secara manual di
"/etc/apt/sources.list
" ke yang baru hanya setelah
menilai situasi sendiri selama sekitar satu bulan setelah rilis keluarga
mayr. Milis pengguna Debian dan pengembang adalah sumber informasi yang
baik untuk ini juga.
Penggunaan keluarga unstable
tidak dianjurkan. Keluarga
unstable
baik untuk debugging
paket sebagai pengembang tetapi cenderung mengekspos Anda untuk
risiko yang tidak perlu untuk penggunaan Desktop normal. Meskipun keluarga
sistem Debian unstable
terlihat sangat stabil untuk
sebagian besar waktu, ada beberapa masalah paket dan beberapa di antaranya
tidak begitu sepele untuk diselesaikan.
Berikut adalah beberapa ide tindakan pencegahan dasar untuk memastikan pemulihan cepat dan mudah dari bug dalam paket Debian.
Buat sistem boot ganda dengan memasang
sistem Debian keluarga stable
ke partisi lain
Buat CD instalasi tersedia untuk boot penyelamatan
Pertimbangkan untuk memasang apt-listbugs
untuk memeriksa
informasi Debian Bug Tracking
System (BTS) sebelum peningkatan
Pelajari infrastruktur sistem paket yang cukup untuk mengatasi masalah
Pasang paket biner hulu sandbox yang sesuai jika terjadi masalah (lihat Bagian 7.6, “Sandbox”)
Buat chroot atau lingkungan serupa dan jalankan sistem terbaru di dalamnya terlebih dahulu (lihat Bagian 9.11, “Sistem tervirtualisasi”)
![]() |
Perhatian |
---|---|
Jika Anda tidak dapat melakukan salah satu dari tindakan pencegahan ini,
Anda mungkin tidak siap untuk keluarga |
Mari kita lihat arsip Debian dari perspektif pengguna sistem.
![]() |
Tip |
---|---|
Kebijakan resmi arsip Debian didefinisikan di Manual Kebijakan Debian, Bab 2 - Arsip Debian. |
Untuk akses HTTP yang umum, arsip dinyatakan dalam berkas
"/etc/apt/sources.list
" sebagai berikut, mis. untuk
sistem stable
= bullseye
saat
ini.
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://security.debian.org/debian-security bullseye-security main contrib deb-src http://security.debian.org/debian-security bullseye-security main contrib
Di sini, saya cenderung menggunakan nama kode
"bullseye
" alih-alih nama keluarga
"stable
" untuk menghindari kejutan ketika
stable
berikutnya dirilis.
Arti "/etc/apt/sources.list
" dijelaskan dalam
sources.list
(5) dan poin-poin penting adalah berikut.
Baris "deb
" mendefinisikan paket biner.
Baris "deb-src
" mendefinisikan paket sumber.
Argumen pertama adalah URL root dari arsip Debian.
Argumen kedua adalah nama distribusi: baik nama keluarga atau nama kode.
Argumen ke-3 dan yang mengikutinya adalah daftar nama area arsip yang valid dari arsip Debian.
Baris "deb-src
" dapat dihilangkan dengan aman (atau
dikomentari dengan menempatkan "#" di awal baris) jika hanya untuk
aptitude
yang tidak mengakses data meta terkait
sumber. Ini mempercepat pembaruan data meta arsip. URL bisa
"http://
", "ftp://
",
"file://
", ….
![]() |
Tip |
---|---|
Jika " |
Berikut adalah daftar URL situs arsip Debian dan nama keluarga atau nama kode yang digunakan dalam berkas konfigurasi.
Tabel 2.2. Daftar situs arsip Debian
URL arsip | nama keluarga (nama kode) | kegunaan |
---|---|---|
http://deb.debian.org/debian/ | stable (bullseye ) |
rilis (bullseye) stable |
http://deb.debian.org/debian/ | testing (bookworm ) |
rilis (bookworm) testing |
http://deb.debian.org/debian/ | unstable (sid ) |
rilis (sid) unstable |
http://deb.debian.org/debian/ | experimental |
pra-rilis eksperimental (opsional, hanya untuk pengembang) |
http://deb.debian.org/debian/ | stable-proposed-updates
(bullseye-proposed-updates ) |
Pembaruan untuk rilis titik stable berikutnya (bullseye) (opsional) |
http://deb.debian.org/debian/ | stable-updates (bullseye-updates ) |
pembaruan yang kompatibel untuk filter spam, klien IM, dll. untuk stabil (bullseye) |
http://deb.debian.org/debian/ | stable-backports
(bullseye-backports ) |
paket di-backport yang lebih baru untuk stable (bullseye) (opsional) |
http://security.debian.org/debian-security/ | stable-security
(bullseye-security ) |
pembaruan keamanan untuk rilis stabil (bullseye) (penting) |
http://security.debian.org/debian-security/ | testing-security
(bookworm-security ) |
pembaruan keamanan untuk rilis testing (Ini tidak didukung secara aktif oleh tim keamanan) |
![]() |
Perhatian |
---|---|
Hanya rilis |
![]() |
Perhatian |
---|---|
Anda pada dasarnya harus mencantumkan hanya satu keluarga
|
![]() |
Tip |
---|---|
Untuk sistem Debian dengan keluarga |
![]() |
Catatan |
---|---|
Bug keamanan untuk arsip |
Tabel 2.3. Daftar area arsip Debian
area | banyaknya paket | kriteria komponen paket |
---|---|---|
main |
64285 | Patuh DFSG dan tidak ada ketergantungan terhadap non-free |
contrib |
356 | Patuh DFSG tetapi memiliki ketergantungan ke non-free |
non-free |
770 | tidak patuh DFSG |
Di sini jumlah paket di atas adalah untuk arsitektur amd64. Area
main
menyediakan sistem Debian (lihat Bagian 2.1.5, “Debian adalah perangkat lunak 100% bebas”).
Organisasi arsip Debian dapat dipelajari paling baik dengan mengarahkan
peramban Anda ke setiap URL arsip ditambah dengan dists
atau pool
.
Distribusi disebut dengan dua cara, keluarga atau nama kode. Kata distribusi secara alternatif digunakan sebagai sinonim untuk keluarga dalam banyak dokumentasi. Hubungan antara keluarga dan nama kode dapat diringkas sebagai berikut.
Tabel 2.4. Hubungan antara keluarga dan nama kode
Kapan | suite = stable |
suite = testing |
suite = unstable |
---|---|---|---|
setelah rilis bullseye |
codename = bullseye |
codename = bookworm |
codename = sid |
setelah rilis bookworm |
codename = bookworm |
codename = trixie |
codename = sid |
Riwayat nama kode dijelaskan dalam DEBIAN FAQ: 6.2.1 Nama kode lain mana yang telah digunakan di masa lalu?
Dalam terminologi arsip Debian yang lebih ketat, kata "section" secara khusus digunakan untuk kategorisasi paket oleh area aplikasi. (Meskipun, kata "main section" kadang-kadang dapat digunakan untuk menggambarkan area arsip Debian bernama "main".)
Setiap kali pengunggahan baru, dilakukan oleh pengembang Debian (DD) ke
arsip unstable
(melalui pemrosesan incoming), DD perlu memastikan paket yang diunggah
kompatibel dengan set paket terbaru dalam arsip unstable
terakhir.
Jika DD merusak kompatibilitas ini dengan sengaja untuk peningkatan pustaka penting dll, biasanya ada pengumuman ke milis debian-devel dll.
Sebelum satu set paket dipindahkan oleh skrip pemeliharaan arsip Debian dari
arsip unstable
ke arsip testing
, skrip
pemeliharaan arsip tidak hanya memeriksa kematangan (sekitar 10 hari) dan
status laporan bug RC untuk paket tetapi juga mencoba untuk memastikan
mereka kompatibel dengan set paket terbaru dalam arsip
testing
. Proses ini membuat arsip
testing
sangat terkini dan dapat digunakan.
Melalui proses pembekuan arsip bertahap yang dipimpin oleh tim rilis, arsip
testing
matang untuk membuatnya benar-benar konsisten dan
bebas bug dengan beberapa intervensi manual. Kemudian rilis
stable
baru dibuat dengan menetapkan nama kode untuk
arsip testing
lama ke arsip stable
baru dan membuat nama kode baru untuk arsip testing
baru. Isi awal dari arsip testing
baru persis sama
dengan arsip stable
yang baru saja dirilis.
Baik arsip unstable
dan testing
mungkin menderita gangguan sementara karena beberapa faktor.
Pengunggahan paket rusak ke arsip (kebanyakan untuk
unstable
)
Penundaan menerima paket baru ke arsip (sebagian besar untuk
unstable
)
Masalah waktu sinkronisasi arsip (baik untuk testing
dan
unstable
)
Intervensi manual ke arsip seperti penghapusan paket (lebih untuk
testing
) dll.
Jadi jika Anda pernah memutuskan untuk menggunakan arsip ini, Anda harus dapat memperbaiki atau mengatasi gangguan semacam ini.
![]() |
Perhatian |
---|---|
Selama sekitar beberapa bulan setelah rilis |
![]() |
Tip |
---|---|
Saat melacak arsip |
Lihat Manual Kebijakan Debian untuk definisi arsip.
"Bagian"
Debian adalah perangkat lunak 100% bebas karena yang berikut ini:
Debian hanya memasang perangkat lunak bebas secara baku untuk menghormati kebebasan pengguna.
Debian hanya menyediakan perangkat lunak bebas di main
.
Debian merekomendasikan untuk hanya menjalankan perangkat lunak bebas dari
main
.
Tidak ada paket main
yang bergantung atau
merekomendasikan paket dalam non-free
atau
contrib
.
Beberapa orang bertanya-tanya apakah 2 fakta berikut bertentangan atau tidak.
"Debian akan tetap 100% bebas". (Istilah pertama dari Kontrak Sosial Debian)
Server Debian mewadahi beberapa paket non-free
dan
contrib
.
Ini tidak bertentangan, karena hal-hal berikut.
Sistem Debian adalah 100% bebas dan paketnya diwadahi oleh server Debian di
area main
.
Paket di luar sistem Debian diwadahi oleh server Debian di area
non-free
dan contrib
.
Ini dijelaskan secara tepat dalam ketentuan ke-4 dan ke-5 dari Kontrak Sosial Debian:
Prioritas kami adalah pengguna kami dan perangkat lunak bebas
Kami akan dipandu oleh kebutuhan pengguna kami dan komunitas perangkat lunak bebas. Kami akan menempatkan kepentingan mereka terlebih dahulu dalam prioritas kami. Kami akan mendukung kebutuhan pengguna kami untuk beroperasi di berbagai jenis lingkungan komputasi. Kami tidak akan keberatan dengan karya non-bebas yang dimaksudkan untuk digunakan pada sistem Debian, atau mencoba untuk membebankan biaya kepada orang-orang yang membuat atau menggunakan karya tersebut. Kami akan mengizinkan orang lain untuk membuat distribusi yang berisi sistem Debian dan karya lainnya, tanpa biaya apa pun dari kami. Sebagai kelanjutan dari tujuan ini, kami akan menyediakan sistem terpadu dengan bahan-bahan berkualitas tinggi tanpa batasan hukum yang akan mencegah penggunaan sistem tersebut.
Karya yang tidak memenuhi standar perangkat lunak bebas kami
Kami mengakui bahwa beberapa pengguna kami memerlukan penggunaan karya yang
tidak sesuai dengan Pedoman Perangkat Lunak Bebas Debian. Kami telah
menciptakan area "contrib
" dan
"non-free
" dalam arsip kami untuk karya-karya
ini. Paket-paket di area ini bukan bagian dari sistem Debian, meskipun telah
dikonfigurasi untuk digunakan dengan Debian. Kami mendorong produsen CD
untuk membaca lisensi paket di area ini dan menentukan apakah mereka dapat
mendistribusikan paket pada CD mereka. Jadi, meskipun karya non-bebas bukan
bagian dari Debian, kami mendukung penggunaannya dan menyediakan
infrastruktur untuk paket-paket non-bebas (seperti sistem pelacakan bug dan
milis kami).
Pengguna harus menyadari risiko menggunakan paket-paket di area
non-free
dan contrib
:
ketiadaan kebebasan untuk paket perangkat lunak tersebut
ketiadaan dukungan dari Debian pada paket perangkat lunak tersebut (Debian tidak dapat mendukung perangkat lunak dengan benar tanpa memiliki akses ke kode sumbernya.)
kontaminasi sistem Debian 100% bebas Anda
The Debian Free Software Guidelines are the free software standards for Debian. Debian interprets "software" in the widest scope including document, firmware, logo, and artwork data in the package. This makes Debian's free software standards very strict ones.
Typical non-free
and contrib
packages
include freely distributable packages of following types:
Document packages under GNU Free
Documentation License with invariant sections such as ones for GCC
and Make. (mostly found in the non-free/doc
section.)
Paket-paket firmware yang berisi data biner tanpa sumber seperti yang
terdaftar dalam Bagian 9.10.5, “Hardware drivers and firmware” sebagai
non-free. (sebagian besar ditemukan di bagian
non-free/kernel
.)
Paket=paket permainan dan fonta dengan pembatasan penggunaan komersial dan/atau modifikasi konten.
Harap dicatat bahwa cacah paket non-free
dan
contrib
kurang dari 2% dari paket-paket
main
. Memfungsikan akses ke area
non-free
dan contrib
tidak mengaburkan
sumber paket. Penggunaan aptitude
(8) layar penuh
interaktif memberi Anda visibilitas penuh dan kontrol atas paket apa yang
dipasang dari area mana untuk menjaga sistem Anda sebebas yang Anda
inginkan.
Sistem Debian menawarkan serangkaian paket biner yang konsisten melalui mekanisme deklarasi ketergantungan biner versinya di ruas berkas control. Berikut adalah sedikit definisi yang disederhanakan untuk mereka.
"Depends"
Ini menyatakan ketergantungan mutlak dan semua paket yang tercantum dalam ruas ini harus dipasang pada saat yang sama atau sebelumnya.
"Pre-Depends"
Ini seperti Depends, kecuali bahwa itu memerlukan instalasi lengkap dari paket yang terdaftar sebelumnya.
"Recommends"
Ini menyatakan ketergantungan yang kuat, tetapi tidak mutlak. Sebagian besar pengguna tidak menginginkan paket kecuali semua paket yang tercantum di ruas ini dipasang.
"Suggests"
Ini menyatakan ketergantungan yang lemah. Banyak pengguna paket ini mungkin mendapat manfaat dari memasang paket yang tercantum di ruas ini tetapi dapat memiliki fungsi yang wajar tanpa mereka.
"Enhances"
Ini menyatakan ketergantungan lemah seperti Suggests tetapi bekerja ke arah yang berlawanan.
"Breaks"
Ini menyatakan ketidakcocokan paket biasanya dengan beberapa spesifikasi versi. Umumnya resolusinya adalah untuk meningkatkan semua paket yang tercantum dalam ruas ini.
"Conflicts"
Ini menyatakan ketidakcocokan mutlak. Semua paket yang tercantum di ruas ini harus dihapus untuk memasang paket ini.
"Replaces"
Ini dinyatakan ketika berkas yang dipasang oleh paket ini menggantikan berkas dalam paket yang terdaftar.
"Provides"
Ini dinyatakan ketika paket ini menyediakan semua berkas dan fungsionalitas dalam paket yang terdaftar.
![]() |
Catatan |
---|---|
Please note that defining "Provides", "Conflicts" and "Replaces" simultaneously to an virtual package is the sane configuration. This ensures that only one real package providing this virtual package can be installed at any one time. |
Definisi resmi termasuk ketergantungan sumber dapat ditemukan dalam Manual Kebijakan: Bab 7 - Mendeklarasikan hubungan antar paket.
Berikut adalah ringkasan dari alur kejadian yang disederhanakan dari manajemen paket oleh APT.
Pembaruan ("apt
update
", "aptitude update
", atau
"apt-get update
"):
Fetch archive metadata from remote archive
Reconstruct and update local metadata for use by APT
Peningkatan ("apt
upgrade
"dan"apt full-upgrade
",
atau"aptitude safe-upgrade
" dan ""aptitude
full-upgrade
", atau "apt-get upgrade
" dan
"apt-get dist-upgrade
"):
Chose candidate version which is usually the latest available version for all installed packages (see Bagian 2.7.3, “Tweaking candidate version” for exception)
Membuat resolusi ketergantungan paket
Fetch selected binary packages from remote archive if candidate version is different from installed version
Unpack fetched binary packages
Jalankan skrip preinst
Memasang berkas biner
Jalankan skrip postinst
Install ("apt install
…
", aptitude install …
" or "apt-get
install …
"):
Pilih paket yang tercantum di baris perintah
Membuat resolusi ketergantungan paket
Fetch selected binary packages from remote archive
Unpack fetched binary packages
Jalankan skrip preinst
Memasang berkas biner
Jalankan skrip postinst
Menghapus ("apt remove
...
", " aptitude remove ...
", atau
"apt-get remove ...
"):
Pilih paket yang tercantum di baris perintah
Membuat resolusi ketergantungan paket
Jalankan skrip prerm
Menghapus berkas yang dipasang kecuali berkas konfigurasi
Jalankan skrip postrm
Purge ("apt purge
",
"aptitude purge …
" or "apt-get purge
…
"):
Pilih paket yang tercantum di baris perintah
Membuat resolusi ketergantungan paket
Jalankan skrip prerm
Menghapus berkas yang dipasang termasuk berkas konfigurasi
Jalankan skrip postrm
Here, I intentionally skipped technical details for the sake of big picture.
Anda harus membaca dokumentasi resmi yang bagus. Dokumen pertama yang
dibaca adalah spesifik Debian
"/usr/share/doc/nama_paket/README.
Debian
". Dokumentasi lain dalam
"/usr/share/doc/nama_paket/
" harus
dikonsultasikan juga. Jika Anda mengatur shell sebagai Bagian 1.4.2, “Menyesuaikan bash”, ketikkan yang berikut ini.
$ cd package_name
$ pager README.Debian
$ mc
Anda mungkin perlu memasang paket dokumentasi yang sesuai yang memiliki nama
dengan akhiran "-doc
" untuk informasi terperinci.
Jika Anda mengalami masalah dengan paket tertentu, pastikan untuk terlebih dahulu memeriksa situs Debian bug tracking system (BTS).
Tabel 2.5. Daftar situs web kunci untuk menyelesaikan masalah dengan paket tertentu
situs web | perintah |
---|---|
Halaman beranda sistem pelacakan bug Debian (Bug Tracking System/BTS) | sensible-browser "http://bugs.debian.org/" |
Laporan bug dari nama paket yang dikenal | sensible-browser
"http://bugs.debian.org/nama_paket" |
Laporan bug dari nomor bug yang diketahui | sensible-browser
"http://bugs.debian.org/nomor_bug" |
Cari di Google dengan kata-kata pencarian
termasuk "site:debian.org
",
"site:wiki.debian.org
",
"site:lists.debian.org
", dll.
Saat Anda mengajukan laporan bug, silakan gunakan perintah
reportbug
(1).
Operasi manajemen paket berbasis repositori pada sistem Debian dapat
dilakukan oleh banyak alat manajemen paket berbasis APT yang tersedia pada
sistem Debian. Di sini, kami menjelaskan 3 alat manajemen paket dasar:
apt
, apt-get
/
apt-cache
, dan aptitude
.
For the package management operation which involves package installation or updates package metadata, you need to have root privilege.
Although aptitude
is a very nice interactive tool which
the author mainly uses, you should know some cautionary facts:
Perintah aptitude
tidak dianjurkan untuk meningkatkan
sistem rilis ke rilis pada sistem Debian stable
setelah
rilis baru.
Penggunaan "apt full-upgrade
" atau "apt-get
dist-upgrade
" direkomendasikan untuk itu. Lihat Bug #411280.
Perintah aptitude
kadang menyarankan penghapusan paket
massal untuk peningkatan sistem pada sistem Debian
testing
atau unstable
.
Situasi ini telah membuat takut banyak administrator sistem. Jangan panik.
Hal ini tampaknya sebagian besar disebabkan oleh ketidaksepakatan versi di
antara paket-paket yang tergantung atau direkomendasikan oleh paket meta
seperti gnome-core
.
Hal ini dapat diselesaikan dengan memilih "Batalkan tindakan yang tertunda"
di menu perintah aptitude
, keluar dari
aptitude
, dan menggunakan "apt
full-upgrade
".
Perintah apt-get
dan apt-cache
adalah
alat manajemen paket berbasis APT yang paling dasar.
apt-get
dan apt-cache
hanya menawarkan
antarmuka pengguna baris perintah.
apt-get
paling cocok untuk peningkatan sistem mayor antara rilis, dll.
apt-get
offers a robust package dependency resolver.
apt-get
kurang menuntut sumber daya perangkat keras. Ini
mengkonsumsi lebih sedikit memori dan berjalan lebih cepat.
apt-cache
menawarkan pencarian berbasis regex standar pada nama dan deskripsi paket.
apt-get
dan apt-cache
dapat mengelola
beberapa versi paket menggunakan /etc/apt/preferences
tetapi cukup rumit.
Perintah apt
adalah antarmuka baris perintah tingkat
tinggi untuk manajemen paket. Ini pada dasarnya adalah pembungkus
apt-get
, apt-cache
, dan
perintah-perintah serupa, awalnya dimaksudkan sebagai antarmuka pengguna
akhir dan memungkinkan beberapa opsi yang lebih cocok untuk penggunaan
interaktif secara default.
apt
menyediakan bilah kemajuan yang ramah saat memasang
paket menggunakan apt install
.
apt
akan menghapus
paket .deb
yang disinggahkan secara baku setelah
instalasi paket yang diunduh dengan sukses.
![]() |
Tip |
---|---|
Pengguna disarankan untuk menggunakan perintah |
Perintah aptitude
adalah alat manajemen paket berbasis
APT yang paling serbaguna.
aptitude
menawarkan antarmuka pengguna teks interaktif
layar penuh.
aptitude
menawarkan antarmuka pengguna baris perintah
juga.
aptitude
paling cocok untuk manajemen paket interaktif harian seperti memeriksa
paket yang dipasang dan mencari paket yang tersedia.
aptitude
lebih menuntut pada sumber daya perangkat
keras. Ini mengkonsumsi lebih banyak memori dan berjalan lebih lambat.
aptitude
menawarkan pencarian berbasis regex yang
disempurnakan pada semua metadata paket.
aptitude
dapat mengelola beberapa versi paket tanpa
menggunakan /etc/apt/preferences
dan itu cukup intuitif.
Berikut adalah operasi manajemen paket dasar dengan baris perintah
menggunakan apt
(8), aptitude
(8), dan
apt-get
(8) /apt-cache
(8).
Tabel 2.6. Operasi manajemen paket dasar dengan baris perintah menggunakan
apt
(8), aptitude
(8), dan
apt-get
(8) /apt-cache
(8)
sintaks apt |
aptitude syntax |
sintaks apt-get /apt-cache |
deskripsi |
---|---|---|---|
apt update |
aptitude update |
apt-get update |
memperbarui metadata arsip paket |
apt install anu |
aptitude install foo |
apt-get install foo |
memasang versi kandidat paket "foo " dengan dependensinya |
apt upgrade |
aptitude safe-upgrade |
apt-get upgrade |
memasang versi kandidat dari paket yang terpasang tanpa menghapus paket lain |
apt full-upgrade |
aptitude full-upgrade |
apt-get dist-upgrade |
memasang versi kandidat paket yang terpasang sambil menghapus paket lain jika diperlukan |
apt remove anu |
aptitude remove foo |
apt-get remove foo |
menghapus paket "foo " sambil membiarkan berkas
konfigurasinya |
apt autoremove |
T/T | apt-get autoremove |
menghapus paket yang terpasang secara otomatis yang tidak lagi diperlukan |
apt purge anu |
aptitude purge foo |
apt-get purge foo |
purge "foo " package with its configuration files |
apt clean |
aptitude clean |
apt-get clean |
membersihkan sepenuhnya repositori lokal dari berkas-berkas paket yang diambil |
apt autoclean |
aptitude autoclean |
apt-get autoclean |
membersihkan repositori lokal dari berkas-berkas paket yang diambil untuk paket-paket usang |
apt show anu |
aptitude show foo |
apt-cache show foo |
menampilkan informasi terperinci tentang paket "foo " |
apt search regex |
aptitude search regex |
apt-cache search regex |
mencari paket-paket yang cocok dengan regex |
T/T | aptitude why regex |
T/T | menjelaskan alasan mengapa paket-paket yang cocok regex harus dipasang |
T/T | aptitude why-not regex |
T/T | menjelaskan alasan mengapa paket-paket yang cocok regex tidak dapat dipasang |
T/T | aptitude search '~i!~M' |
apt-mark showmanual |
menampilkan daftar paket yang dipasang secara manual |
apt
/ apt-get
dan
aptitude
dapat dicampur tanpa masalah besar.
"aptitude why regex
" dapat
mencantumkan lebih banyak informasi dengan ""aptitude -v why
regex
". Informasi serupa dapat diperoleh
dengan "apt rdepends paket
" atau
"apt-cache rdepends paket
".
Ketika perintah aptitude
dimulai dalam mode baris
perintah dan menghadapi beberapa masalah seperti konflik paket, Anda dapat
beralih ke mode interaktif layar penuh dengan menekan tombol
"e
" nanti di prompt.
![]() |
Catatan |
---|---|
Meskipun perintah |
Anda dapat memberikan opsi perintah tepat setelah
"aptitude
".
Tabel 2.7. Opsi perintah penting untuk aptitude
(8)
opsi perintah | deskripsi |
---|---|
-s |
mensimulasikan hasil perintah |
-d |
unduh saja tetapi jangan pasang/tingkatkan |
-D |
menampilkan penjelasan singkat sebelum instalasi dan penghapusan otomatis |
Lihat aptitude
(8) dan "manual pengguna aptitude" di
"/usr/share/doc/aptitude/README
" untuk lebih lanjut.
Untuk manajemen paket interaktif, Anda memulai aptitude
dalam mode interaktif dari prompt shell konsol sebagai berikut.
$ sudo aptitude -u Password:
Ini memperbarui salinan lokal dari informasi arsip dan menampilkan daftar
paket di layar penuh dengan menu. Aptitude menempatkan konfigurasinya di
"~/.aptitude/config
".
![]() |
Tip |
---|---|
Jika Anda ingin menggunakan konfigurasi root sebagai pengganti milik
pengguna, gunakan " |
![]() |
Tip |
---|---|
|
Ketukan kunci penting untuk menelusuri status paket dan untuk mengatur "tindakan yang direncanakan" pada mereka dalam mode layar penuh ini adalah sebagai berikut.
Tabel 2.8. Daftar pengikatan tombol untuk aptitude
tombol | pengikatan tombol |
---|---|
F10 atau Ctrl-t |
menu |
? |
menampilkan bantuan untuk ketukan tombol (daftar yang lebih lengkap) |
F10 → Bantuan → Manual Pengguna |
menampilkan Manual Pengguna |
u |
memperbarui informasi arsip paket |
+ |
menandai paket untuk peningkatan atau instalasi |
- |
menandai paket untuk dihapus (menyimpan berkas konfigurasi) |
_ |
mark the package for the purge (remove configuration files) |
= |
menempatkan paket ke keadaan ditahan |
U |
menandai semua paket yang dapat ditingkatkan (berfungsi sebagai full-upgrade) |
g |
mulai mengunduh dan memasang paket-paket yang dipilih |
q |
keluar dari layar saat ini dan menyimpan perubahan |
x |
keluar dari layar saat ini dan membuang perubahan |
Enter |
melihat informasi tentang paket |
C |
melihat changelog paket |
l |
mengubah batas untuk paket yang ditampilkan |
/ |
mencari kecocokan pertama |
\ |
mengulangi pencarian terakhir |
Spesifikasi nama berkas dari baris perintah dan prompt menu setelah menekan
"l
" dan "//
" menerima regex aptitude
seperti yang dijelaskan di bawah ini. Regex aptitude dapat secara eksplisit
mencocokkan nama paket menggunakan string yang dimulai dengan
"~n
" dan diikuti dengan nama paket.
![]() |
Tip |
---|---|
Anda perlu menekan " |
Dalam mode aptitude
(8) layar penuh interaktif,
paket-paket dalam daftar paket ditampilkan seperti contoh berikutnya.
idA libsmbclient -2220kB 3.0.25a-1 3.0.25a-2
Di sini, baris ini berarti dari kiri sebagai berikut.
Bendera "keadaan saat ini" (huruf pertama)
Bendera "tindakan yang direncanakan" (huruf kedua)
Bendera "otomatis" (huruf ketiga)
Nama paket
Perubahan penggunaan ruang disk yang dikaitkan dengan "tindakan yang direncanakan"
Versi paket saat ini
Versi kandidat dari paket
![]() |
Tip |
---|---|
Daftar lengkap bendera diberikan di bagian bawah layar Bantuan yang ditampilkan dengan menekan
" |
Versi kandidat dipilih sesuai dengan
preferensi lokal saat ini (lihat apt_preferences
(5) dan
Bagian 2.7.3, “Tweaking candidate version”).
Beberapa jenis tampilan paket tersedia di bawah menu
"Tampilan
".
Tabel 2.9. Daftar tampilan untuk aptitude
tampilan | deskripsi tampilan |
---|---|
Tampilan Paket |
lihat Tabel 2.10, “Kategorisasi tampilan paket standar” (baku) |
Rekomendasi Audit |
list packages which are recommended by some installed packages but not yet installed |
Flat Package List |
list packages without categorization (for use with regex) |
Debtags Browser |
list packages categorized according to their debtags entries |
Source Package View |
list packages grouped by source packages |
![]() |
Catatan |
---|---|
Please help us improving tagging packages with debtags! |
The standard "Package View
" categorizes packages somewhat
like dselect
with few extra features.
Tabel 2.10. Kategorisasi tampilan paket standar
kategori | deskripsi tampilan |
---|---|
Paket yang Dapat Ditingkatkan |
list packages organized as section →
area → package |
Paket Baru |
, , |
Paket Terpasang |
, , |
Paket Tidak Terpasang |
, , |
Obsolete and Locally Created Packages |
, , |
Paket Virtual |
daftar paket dengan fungsi yang sama |
Tugas |
list packages with different functions generally needed for a task |
![]() |
Tip |
---|---|
|
Aptitude offers several options for you to search packages using its regex formula.
Baris perintah shell:
"aptitude search 'regex_aptitude'
"
untuk daftar status instalasi, nama paket, dan deskripsi singkat dari paket
yang cocok
"aptitude show 'nama_paket'
" untuk
daftar deskripsi rinci dari paket
Interactive full screen mode:
"l
" to limit package view to matching packages
"/
" untuk pencarian ke paket yang cocok
"\
" for backward search to a matching package
"n
" for find-next
"N
" for find-next (backward)
![]() |
Tip |
---|---|
The string for package_name is treated as the exact
string match to the package name unless it is started explicitly with
" |
Rumus regex aptitude adalah ERE diperluas
mirip mutt (lihat Bagian 1.6.2, “Ekspresi reguler”) dan arti dari
ekstensi aturan kecocokan khusus spesifik aptitude
adalah
sebagai berikut.
Tabel 2.11. Daftar rumus regex aptitude
description of the extended match rule | rumus regex |
---|---|
cocok pada nama paket | ~nregex_nama |
cocok pada deskripsi | ~dregex_deskripsi |
cocokkan pada nama task | ~tregex_tugas |
cocok dengan debtag | ~Gregex_debtag |
cocok pada maintainer | ~mregex_pemelihara |
cocok pada bagian paket | ~sregex_seksi |
cocok pada versi paket | ~Vregex_versi |
cocok arsip | ~A{bullseye,bookworm,sid } |
cocok asal | ~O{debian,… } |
cocok prioritas | ~p{extra,important,optional,required,standard } |
cocok paket esensial | ~E |
cocok paket virtual | ~v |
cocok paket baru | ~N |
cocok dengan tindakan yang tertunda | ~a{install,upgrade,downgrade,remove,purge,hold,keep } |
cocok paket terpasang | ~i |
match installed packages with A-mark (auto installed packages) | ~M |
match installed packages without A-mark (administrator selected packages) | ~i!~M |
cocok dengan paket-paket yang dipasang dan dapat ditingkatkan | ~U |
cocok dengan paket-paket yang dihapus tetapi belum dibersihkan | ~c |
cocok dengan paket-paket yang dihapus, dibersihkan, atau dapat-dihapus | ~g |
cocok dengan paket-paket yang menyatakan ketergantungan yang rusak | ~b |
match packages declaring broken dependency of type | ~Btipe |
match pattern packages declaring dependency of type | ~D[type:]pattern |
match pattern packages declaring broken dependency of type | ~DB[type:]pattern |
match packages to which the pattern matching package declares dependency type | ~R[type:]pattern |
match packages to which the pattern matching package declares broken dependency type | ~RB[type:]pattern |
match packages to which some other installed packages depend on | ~R~i |
match packages to which no other installed packages depend on | !~R~i |
match packages to which some other installed packages depend or recommend on | ~R~i|~Rrecommends:~i |
match pattern package with filtered version | ~S penyaring pola |
cocok dengan semua paket (benar) | ~T |
tidak cocok dengan paket apa pun (salah) | ~F |
The regex part is the same ERE as the one
used in typical Unix-like text tools using "^
",
".*
", "$
" etc. as in
egrep
(1), awk
(1) and
perl
(1).
The dependency type is one of (depends, predepends, recommends, suggests, conflicts, replaces, provides) specifying the package interrelationship.
The default dependency type is "depends".
![]() |
Tip |
---|---|
When regex_pattern is a null string, place
" |
Berikut adalah beberapa pintasan.
"~Pistilah
" ==
"~Dprovides:istilah
"
"~Cistilah
" ==
"~Dconflicts:istilah
"
"…~W istilah
" == "(…|istilah)
"
Pengguna yang akrab dengan mutt
belajar dengan cepat,
karena mutt adalah inspirasi untuk sintaks ekspresi. Lihat "MENCARI,
MEMBATASI, DAN EKSPRESI" di "Manual Pengguna"
"/usr/share/doc/aptitude/README
".
![]() |
Catatan |
---|---|
Dengan versi |
Pemilihan paket dalam aptitude
tidak hanya menarik paket
yang didefinisikan dalam daftar "Depends:
" tetapi juga
didefinisikan dalam daftar "Recommends:
" jika menu "Opsi
→F10
→ Preferensi → Penanganan Ketergantungan" diatur
sesuai dengan itu. Paket yang dipasang otomatis ini dihapus secara otomatis
jika tidak lagi diperlukan di bawah aptitude
.
Bendera yang mengendalikan perilaku "pemasangan otomatis" dari perintah
aptitude
juga dapat dimanipulasi menggunakan perintah
apt-mark
(8) dari paket apt
.
Anda dapat memeriksa riwayat aktivitas paket di berkas-berkas log.
Tabel 2.12. Berkas-berkas log untuk aktivitas paket
berkas | isi |
---|---|
/var/log/dpkg.log |
Log kegiatan tingkat dpkg untuk semua kegiatan paket |
/var/log/apt/term.log |
Log aktivitas APT generik |
/var/log/aptitude |
Log aktivitas perintah aptitude |
Pada kenyataannya, tidak mudah untuk mendapatkan pemahaman yang berarti dengan cepat dari log ini. Lihat Bagian 9.3.9, “Merekam perubahan dalam berkas konfigurasi” untuk cara yang lebih mudah.
Berikut adalah beberapa contoh operasi aptitude
(8).
The following command lists packages with regex matching on package names.
$ aptitude search '~n(pam|nss).*ldap' p libnss-ldap - NSS module for using LDAP as a naming service p libpam-ldap - Pluggable Authentication Module allowing LDAP interfaces
This is quite handy for you to find the exact name of a package.
The regex "~dipv6
" in the "New Flat Package List" view
with "l
" prompt, limits view to packages with the
matching description and let you browse their information interactively.
Anda dapat membersihkan semua berkas konfigurasi yang tersisa dari paket yang dihapus.
Periksa hasil perintah berikut.
# aptitude search '~c'
If you think listed packages are OK to be purged, execute the following command.
# aptitude purge '~c'
You may want to do the similar in the interactive mode for fine grained control.
You provide the regex "~c
" in the "New Package View" view
with "l
" prompt. This limits the package view only to
regex matched packages, i.e., "removed but not purged". All these regex
matched packages can be shown by pressing "[
" at top
level headings.
Then you press "_
" at top level headings such as "Not
Installed Packages". Only regex matched packages under the heading are
marked to be purged by this. You can exclude some packages to be purged by
pressing "=
" interactively for each of them.
This technique is quite handy and works for many other command keys.
Berikut adalah cara saya merapikan status pemasangan otomatis/manual untuk paket (setelah menggunakan pemasang paket non-aptitude dll.).
Mulai aptitude
dalam mode interaktif sebagai root.
Ketik "u
", "U
",
"f
", dan "g
" untuk memperbarui dan
meningkatkan daftar paket dan paket-paket.
Type "l
" to enter the package display limit as
"~i(~R~i|~Rrecommends:~i)
" and type
"M
" over "Installed Packages
" as auto
installed.
Type "l
" to enter the package display limit as
"~prequired|~pimportant|~pstandard|~E
" and type
"m
" over "Installed Packages
" as
manual installed.
Ketik "l
" untuk memasukkan batas tampilan paket sebagai
"~i!~M
" dan hapus paket yang tidak terpakai dengan
mengetik "-
" di atas masing-masing setelah mengekspos
mereka dengan mengetik "[
" di atas "Paket
Terpasang
".
Type "l
", to enter the package display limit as
"~i
"; then type "m
" over
"Tasks
", to mark that packages as manual installed.
Keluar dari aptitude
.
Start "apt-get -s autoremove|less
" as root to check what
are not used.
Mulai ulang aptitude
dalam mode interaktif dan tandai
paket yang dibutuhkan sebagai "m
".
Restart "apt-get -s autoremove|less
" as root to recheck
REMOVED contain only expected packages.
Start "apt-get autoremove|less
" as root to autoremove
unused packages.
The "m
" action over "Tasks
" is an
optional one to prevent mass package removal situation in future.
![]() |
Catatan |
---|---|
Saat pindah ke rilis baru dll, Anda harus mempertimbangkan untuk melakukan instalasi yang bersih dari sistem baru meskipun Debian dapat ditingkatkan seperti yang dijelaskan di bawah ini. Ini memberi Anda kesempatan untuk membuang sampah yang dikumpulkan dan menghadapkan Anda ke kombinasi terbaik dari paket terbaru. Tentu saja, Anda harus membuat cadangan penuh sistem ke tempat yang aman (lihat Bagian 10.2, “Backup and recovery”) sebelum melakukan ini. Saya sarankan untuk membuat konfigurasi boot ganda menggunakan partisi yang berbeda untuk mendapatkan transisi yang paling mulus. |
You can perform system wide upgrade to a newer release by changing contents
of the "/etc/apt/sources.list
" file pointing to a new
release and running the "apt update; apt dist-upgrade
"
command.
Untuk meningkatkan dari stable
ke
testing
atau unstable
, Anda mengganti
"bullseye
" dalam contoh
"/etc/apt/sources.list
" dari Bagian 2.1.4, “Dasar-dasar arsip Debian” dengan
"bookworm
" atau "sid
".
In reality, you may face some complications due to some package transition
issues, mostly due to package dependencies. The larger the difference of
the upgrade, the more likely you face larger troubles. For the transition
from the old stable
to the new stable
after its release, you can read its new Release
Notes and follow the exact procedure described in it to minimize
troubles.
When you decide to move from stable
to
testing
before its formal release, there are no Release Notes to help you. The difference
between stable
and testing
could have
grown quite large after the previous stable
release and
makes upgrade situation complicated.
You should make precautionary moves for the full upgrade while gathering latest information from mailing list and using common senses.
Membaca "Catatan Rilis" sebelumnya.
Cadangkan seluruh sistem (terutama data dan informasi konfigurasi).
Have bootable media handy for broken bootloader.
Informasikan ke para pengguna sistem jauh sebelumnya.
Rekam aktivitas peningkatan dengan script
(1).
Terapkan "unmarkauto" ke paket yang diperlukan, mis., "aptitude
unmarkauto vim
", untuk mencegah penghapusan.
Minimalkan paket yang dipasang untuk mengurangi kemungkinan konflik paket, mis., menghapus paket tugas desktop.
Hapus berkas "/etc/apt/preferences
" (nonaktifkan
apt-pinning).
Cobalah untuk meningkatkan secara bertahap: oldstable
→
stable
→ testing
→
unstable
.
Perbarui berkas "/etc/apt/sources.list
" untuk menunjuk
hanya ke arsip baru dan jalankan "aptitude update
".
Pasang terlebih dahulu, secara opsional, paket-paket
inti baru, mis.,"aptitude install perl
".
Jalankan perintah "apt-get -s dist-upgrade
" untuk menilai
dampak.
Pada akhirknya jalankan perintah "apt-get dist-upgrade
".
![]() |
Perhatian |
---|---|
Tidak bijaksana untuk melewatkan rilis Debian mayor ketika meningkatkan
antar rilis |
![]() |
Perhatian |
---|---|
Dalam "Catatan Rilis" sebelumnya, GCC, Kernel Linux, initrd-tools, Glibc, Perl, rantai alat APT, dll. membutuhkan perhatian khusus untuk peningkatan seluruh sistem. |
Untuk peningkatan harian dalam unstable
, lihat Bagian 2.4.3, “Menjaga masalah paket”.
Berikut adalah daftar operasi manajemen paket lain dimana
aptitude
tingkatnya terlalu tinggi atau tidak memiliki
fungsi yang diperlukan.
Tabel 2.13. Daftar operasi manajemen paket tingkat lanjut
perintah | aksi |
---|---|
COLUMNS=120 dpkg -l pola_nama_paket |
menampilkan daftar status paket yang dipasang untuk laporan bug |
dpkg -L nama_paket |
menampilkan daftar isi paket yang dipasang |
dpkg -L nama_paket | egrep
'/usr/share/man/man.*/.+' |
menampilkan daftar halaman man untuk paket yang dipasang |
dpkg -S pola_nama_berkas |
daftar paket terpasang yang memiliki nama berkas yang cocok |
apt-file search pola_nama_berkas |
tampilkan daftar paket dalam arsip yang memiliki nama berkas yang cocok |
apt-file list pola_nama_paket |
menampilkan daftar isi paket yang cocok dalam arsip |
dpkg-reconfigure nama_paket |
mengonfigurasi ulang paket yang tepat |
dpkg-reconfigure -plow nama_paket |
mengonfigurasi ulang paket yang tepat dengan pertanyaan paling rinci |
configure-debian |
mengonfigurasi ulang paket dari menu layar penuh |
dpkg --audit |
mengaudit sistem untuk paket-paket yang terpasang sebagian |
dpkg --configure -a |
mengonfigurasi semua paket yang terpasang sebagian |
apt-cache policy nama_paket_biner |
menampilkan versi yang tersedia, prioritas, dan informasi arsip dari suatu paket biner |
apt-cache madison nama_paket |
menampilkan versi yang tersedia, informasi arsip paket |
apt-cache showsrc nama_paket_biner |
menampilkan informasi paket sumber dari suatu paket biner |
apt-get build-dep nama_paket |
memasang paket-paket yang diperlukan untuk membangun paket |
aptitude build-dep nama_paket |
memasang paket-paket yang diperlukan untuk membangun paket |
apt-get source nama_paket |
mengunduh suatu sumber (dari arsip standar) |
dget URL untuk berkas dsc |
mengunduh suatu paket sumber (dari arsip lainnya) |
dpkg-source -x
nama_paket_versi-revisi.debian.dsc |
membangun pohon sumber dari satu set paket sumber
("*.orig.tar.gz " dan
"*.debian.tar.gz "/"*.diff.gz ") |
debuild binary |
membangun paket dari pohon sumber lokal |
make-kpkg kernel_image |
membangun paket kernel dari pohon sumber kernel |
make-kpkg --initrd kernel_image |
membangun paket kernel dari pohon sumber kernel dengan initramfs diaktifkan |
dpkg -i
nama_paket_versi-revisi.debian_arch.deb |
memasang sebuah paket lokal ke sistem |
apt install
/path/ke/namaberkas_paket.deb |
memasang paket lokal ke sistem, sambil mencoba untuk menyelesaikan ketergantungan secara otomatis |
debi
nama_paket_versi-revisi.debian_arch.dsc |
memasang paket lokal ke sistem |
dpkg --get-selections '*' >pilihan.txt |
menyimpan informasi keadaan pemilihan paket tingkat dpkg |
dpkg --set-selections <pilihan.txt |
mengatur informasi keadaan pemilihan paket tingkat dpkg |
echo nama_paket hold | dpkg
--set-selections |
set dpkg level package selection state for a package to
hold (equivalent to "aptitude
hold package_name ") |
![]() |
Catatan |
---|---|
Untuk paket dengan fitur multi-arch, Anda
mungkin perlu menyatakan nama arsitektur untuk beberapa perintah. Misalnya,
gunakan " |
![]() |
Perhatian |
---|---|
Alat paket tingkat rendah seperti " |
Harap catat hal-hal berikut.
Semua konfigurasi sistem dan perintah instalasi harus dijalankan dari root.
Tidak seperti aptitude
yang menggunakan regex (lihat
Bagian 1.6.2, “Ekspresi reguler”), perintah manajemen paket lainnya
menggunakan pola seperti glob shell (lihat Bagian 1.5.6, “Glob shell”).
apt-file
(1) yang disediakan oleh paket
apt-file
harus menjalankan "apt-file
update
" terlebih dahulu.
configure-debian
(8) yang disediakan oleh paket
configure-debian
menjalankan
dpkg-reconfigure
(8) sebagai backend-nya.
dpkg-reconfigure
(8) menjalankan skrip paket menggunakan
debconf
(1) sebagai backend-nya.
Perintah "apt-get build-dep
", "apt-get
source
", dan "apt-cache showsrc
" memerlukan
entri "deb-src
" di
"/etc/apt/sources.list
".
dget
(1), debuild
(1), dan
debi
(1) memerlukan paket devscripts
.
Lihat prosedur pengemasan (ulang) menggunakan "apt-get
source
" dalam Bagian 2.7.13, “Porting a package to the stable system”.
Perintah make-kpkg
memerlukan paket
kernel-package
(lihat Bagian 9.10, “Kernel”).
Lihat Bagian 12.9, “Membuat paket Debian” untuk pengemasan umum.
Pemasangan debsum
memungkinkan verifikasi berkas paket
yang terpasang terhadap nilai MD5sum dalam berkas
"/var/lib/dpkg/info/*.md5sums
" dengan
debsum
(1). Lihat Bagian 10.3.5, “The MD5 sum” untuk
cara kerja MD5sum.
![]() |
Catatan |
---|---|
Karena database MD5sum dapat dirusak oleh penyusup, penggunaan
|
Banyak pengguna lebih memilih untuk mengikuti rilis sistem Debian unstable untuk fitur dan paket barunya. Hal ini membuat sistem lebih rentan terkena bug paket kritis.
Instalasi paket apt-listbugs
melindungi sistem Anda dari
bug kritis dengan memeriksa Debian BTS secara otomatis untuk bug kritis saat
memutakhirkan dengan sistem APT.
Pemasangan paket apt-listchanges
memberikan berita
penting dalam "NEWS.Debian
" saat memutakhirkan dengan
sistem APT.
Meskipun mengunjungi situs Debian https://packages.debian.org/ memfasilitasi cara mudah untuk mencari data meta paket akhir-akhir ini, mari kita lihat cara yang lebih tradisional.
Perintah grep-dctrl
(1),
grep-status
(1), dan grep-available
(1)
dapat digunakan untuk mencari berkas apa pun yang memiliki format umum
berkas kontrol paket Debian.
The "dpkg -S file_name_pattern
" can
be used to search package names which contain files with the matching name
installed by dpkg
. But this overlooks files created by
the maintainer scripts.
Jika Anda perlu melakukan pencarian yang lebih rumit pada data meta dpkg,
Anda perlu menjalankan perintah "grep -e pola_regex *
" di
direktori "/var/lib/dpkg/info/
". Hal ini membuat Anda
mencari kata-kata yang disebutkan dalam skrip paket dan teks kueri
instalasi.
Jika Anda ingin mencari ketergantungan paket secara rekursif, Anda harus
menggunakan apt-rdepends
(8).
Mari kita pelajari cara kerja sistem manajemen paket Debian secara internal. Ini akan membantu Anda membuat solusi sendiri untuk beberapa masalah paket.
Berkas meta data untuk setiap distribusi disimpan di bawah
"dist/namakode
" pada setiap situs
cermin Debian, mis., "http://deb.debian.org/debian/
".
Struktur arsipnya dapat ditelusuri oleh peramban web. Ada 6 jenis data meta
kunci.
Tabel 2.14. Isi data meta arsip Debian
berkas | lokasi | isi |
---|---|---|
Release |
top of distribution | deskripsi arsip dan informasi integritas |
Release.gpg |
top of distribution | berkas tanda tangan untuk berkas "Release " yang
ditandatangani dengan kunci arsip |
Contents-architecture |
top of distribution | daftar semua berkas untuk semua paket dalam arsip yang bersangkutan |
Release |
top of each distribution/area/architecture combination | archive description used for the rule of
apt_preferences (5) |
Packages |
top of each distribution/area/binary-architecture combination | concatenated debian/control for binary packages |
Sources |
top of each distribution/area/source combination | concatenated debian/control for source packages |
Dalam arsip baru-baru ini, data meta ini disimpan sebagai berkas terkompresi dan diferensial untuk mengurangi lalu lintas jaringan.
![]() |
Tip |
---|---|
Berkas " |
Setiap keluarga arsip Debian memiliki berkas "Release
"
tingkat puncak, mis.,
"http://deb.debian.org/debian/dists/unstable/Release
",
sebagai berikut.
Origin: Debian Label: Debian Suite: unstable Codename: sid Date: Sat, 14 May 2011 08:20:50 UTC Valid-Until: Sat, 21 May 2011 08:20:50 UTC Architectures: alpha amd64 armel hppa hurd-i386 i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel powerpc s390 sparc Components: main contrib non-free Description: Debian x.y Unstable - Not Released MD5Sum: bdc8fa4b3f5e4a715dd0d56d176fc789 18876880 Contents-alpha.gz 9469a03c94b85e010d116aeeab9614c0 19441880 Contents-amd64.gz 3d68e206d7faa3aded660dc0996054fe 19203165 Contents-armel.gz ...
![]() |
Catatan |
---|---|
Here, you can find my rationale to use the "suite", and "codename" in Bagian 2.1.4, “Dasar-dasar arsip Debian”. The "distribution" is used when referring to both "suite" and "codename". All archive "area" names offered by the archive are listed under "Components". |
Integritas berkas "Release
" tingkat puncak diverifikasi
oleh infrastruktur kriptografi yang disebut apt
aman.
The cryptographic signature file "Release.gpg
" is created
from the authentic top level "Release
" file and the
secret Debian archive key.
Kunci arsip Debian publik dapat dibibitkan ke dalam
"/etc/apt/trusted.gpg
";
secara otomatis dengan memasang keyring dengan paket
base-files
terbaru, atau
secara manual oleh gpg
atau alat
apt-key
dengan kunci arsip publik terbaru yang
diposting di ftp-master.debian.org.
The secure APT system verifies the
integrity of the downloaded top level "Release
" file
cryptographically by this "Release.gpg
" file and the
public Debian archive key in "/etc/apt/trusted.gpg
".
The integrity of all the "Packages
" and
"Sources
" files are verified by using MD5sum values in
its top level "Release
" file. The integrity of all
package files are verified by using MD5sum values in the
"Packages
" and "Sources
" files. See
debsums
(1) and Bagian 2.4.2, “Verifikasi berkas-berkas paket yang terpasang”.
Since the cryptographic signature verification is a much more CPU intensive
process than the MD5sum value calculation, use of MD5sum value for each
package while using cryptographic signature for the top level
"Release
" file provides the good security with the
performance (see Bagian 10.3, “Infrastruktur keamanan data”).
![]() |
Tip |
---|---|
Berkas " |
There are archive level "Release
" files for all archive
locations specified by "deb
" line in
"/etc/apt/sources.list
", such as
"http://deb.debian.org/debian/dists/unstable/main/binary-amd64/Release
"
or
"http://deb.debian.org/debian/dists/sid/main/binary-amd64/Release
"
as follows.
Archive: unstable Origin: Debian Label: Debian Component: main Architecture: amd64
![]() |
Perhatian |
---|---|
For " |
For some archives, such as experimental
, and
bullseye-backports
, which contain packages which
should not be installed automatically, there is an extra line, e.g.,
"http://deb.debian.org/debian/dists/experimental/main/binary-amd64/Release
"
as follows.
Archive: experimental Origin: Debian Label: Debian NotAutomatic: yes Component: main Architecture: amd64
Please note that for normal archives without "NotAutomatic:
yes
", the default Pin-Priority value is 500, while for special
archives with "NotAutomatic: yes
", the default
Pin-Priority value is 1 (see apt_preferences
(5) and Bagian 2.7.3, “Tweaking candidate version”).
Ketika alat APT, seperti aptitude
,
apt-get
, synaptic
,
apt-file
, auto-apt
, ... digunakan,
kita perlu memperbarui salinan lokal dari data meta yang berisi informasi
arsip Debian. Salinan lokal ini memiliki nama berkas berikut yang sesuai
dengan distribusi
, area
, dan nama
arsitektur
yang ditentukan dalam
"/etc/apt/sources.list
" (lihat Bagian 2.1.4, “Dasar-dasar arsip Debian”).
"/var/lib/apt/lists/deb.debian.org_debian_dists_distribusi_Release
"
"/var/lib/apt/lists/deb.debian.org_debian_dists_distribusi_Release.gpg
"
"/var/lib/apt/lists/deb.debian.org_debian_dists_distribusi_area_binary-arsitektur_Packages
"
"/var/lib/apt/lists/deb.debian.org_debian_dists_distribusi_area_source_Sources
"
"/var/cache/apt/apt-file/deb.debian.org_debian_dists_distribusi_Contents-arsitektur.gz
"
(untuk apt-file
)
4 jenis berkas pertama dipakai bersama oleh semua perintah APT yang
bersangkutan dan diperbarui dari baris perintah dengan "apt-get
update
" atau "aptitude update
". Data meta
"Packages
" diperbarui jika ada baris
"deb
" di "/etc/apt/sources.list
". Data
meta "Sources
" diperbarui jika ada baris
"deb-src
" di "/etc/apt/sources.list
".
The "Packages
" and "Sources
" meta data
contain "Filename:
" stanza pointing to the file location
of the binary and source packages. Currently, these packages are located
under the "pool/
" directory tree for the improved
transition over the releases.
Salinan lokal dari meta data "Packages
" dapat secara
interaktif dicari dengan bantuan aptitude
. Perintah
pencarian khusus grep-dctrl
(1) dapat mencari salinan
lokal dari meta data "Packages
" dan
"Sources
".
Local copy of
"Contents-architecture
" meta data
can be updated by "apt-file update
" and its location is
different from other 4 ones. See apt-file
(1). (The
auto-apt
uses different location for local copy of
"Contents-architecture.gz
" as
default.)
In addition to the remotely fetched meta data, the APT tool after
lenny
stores its locally generated installation state
information in the "/var/lib/apt/extended_states
" which
is used by all APT tools to track all auto installed packages.
Selain data meta yang diambil dari jarak jauh, perintah
aptitude
menyimpan informasi keadaan instalasi yang
dihasilkan secara lokal di "/var/lib/aptitude/pkgstates
"
yang hanya digunakan olehnya.
All the remotely fetched packages via APT mechanism are stored in the
"/var/cache/apt/archives
" until they are cleaned.
Kebijakan pembersihan berkas singgahan untuk aptitude
ini
dapat diatur di bawah "Opsi
" →
"Preferensi
" dan dapat dipaksa oleh menunya
"Bersihkan singgahan paket
" atau "Bersihkan
berkas usang
" di bawah "Aksi
".
Berkas-berkas paket Debian memiliki struktur nama tertentu.
Tabel 2.15. Struktur nama paket-paket Debian
tipe paket | struktur nama |
---|---|
Paket biner (a.k.a deb ) |
nama-paket_versi-hulu-revisi.debian_arsitektur.deb |
The binary package for debian-installer (a.k.a udeb ) |
nama-paket_versi-hulu-revisi.debian_arsitektur.udeb |
Paket sumber (sumber hulu) | nama-paket_versi-hulu-revisi.debian.orig.tar.gz |
Paket sumber 1.0 (Debian changes) |
nama-paket_versi-hulu-revisi.debian.diff.gz |
Paket sumber 3.0 (quilt) (Debian changes) |
nama-paket_versi-hulu-revisi.debian.debian.tar.gz |
Paket sumber (deskripsi) | nama-paket_versi-hulu-revisi.debian.dsc |
![]() |
Tip |
---|---|
Di sini hanya format paket sumber dasar yang dijelaskan. Lihat selengkapnya
di |
Tabel 2.16. Karakter yang dapat digunakan untuk setiap komponen dalam nama paket Debian
komponen nama | karakter yang dapat digunakan (regex ERE) | eksistensi |
---|---|---|
package-name |
[a-z0-9][-a-z0-9.+]+ |
required |
epoch: |
[0-9]+: |
optional |
upstream-version |
[-a-zA-Z0-9.+:]+ |
required |
debian.revision |
[a-zA-Z0-9.+~]+ |
optional |
![]() |
Catatan |
---|---|
You can check package version order by |
![]() |
Catatan |
---|---|
The debian-installer (d-i) uses
|
dpkg
(1) is the lowest level tool for the Debian package
management. This is very powerful and needs to be used with care.
While installing package called
"package_name
",
dpkg
process it in the following order.
Unpack the deb file ("ar -x
" equivalent)
Execute "package_name.preinst
" using
debconf
(1)
Install the package content to the system ("tar -x
"
equivalent)
Execute "package_name.postinst
"
using debconf
(1)
The debconf
system provides standardized user interaction
with I18N and L10N (Bab 8, I18N dan L10N) supports.
Tabel 2.17. The notable files created by dpkg
berkas | deskripsi konten |
---|---|
/var/lib/dpkg/info/nama_paket.conffiles |
list of configuration files. (user modifiable) |
/var/lib/dpkg/info/nama_paket.list |
list of files and directories installed by the package |
/var/lib/dpkg/info/package_name.md5sums |
list of MD5 hash values for files installed by the package |
/var/lib/dpkg/info/nama_paket.preinst |
package script to be run before the package installation |
/var/lib/dpkg/info/nama_paket.postinst |
package script to be run after the package installation |
/var/lib/dpkg/info/nama_paket.prerm |
package script to be run before the package removal |
/var/lib/dpkg/info/nama_paket.postrm |
package script to be run after the package removal |
/var/lib/dpkg/info/nama_paket.config |
package script for debconf system |
/var/lib/dpkg/alternatives/nama_paket |
the alternative information used by the
update-alternatives command |
/var/lib/dpkg/available |
the availability information for all the package |
/var/lib/dpkg/diversions |
the diversions information used by dpkg (1) and set by
dpkg-divert (8) |
/var/lib/dpkg/statoverride |
the stat override information used by dpkg (1) and set by
dpkg-statoverride (8) |
/var/lib/dpkg/status |
the status information for all the packages |
/var/lib/dpkg/status-old |
the first-generation backup of the "var/lib/dpkg/status "
file |
/var/backups/dpkg.status* |
the second-generation backup and older ones of the
"var/lib/dpkg/status " file |
The "status
" file is also used by the tools such as
dpkg
(1), "dselect update
" and
"apt-get -u dselect-upgrade
".
The specialized search command grep-dctrl
(1) can search
the local copies of "status
" and
"available
" meta data.
![]() |
Tip |
---|---|
In the debian-installer
environment, the |
The Debian system has mechanism to install somewhat overlapping programs
peacefully using update-alternatives
(1). For example,
you can make the vi
command select to run
vim
while installing both vim
and
nvi
packages.
$ ls -l $(type -p vi) lrwxrwxrwx 1 root root 20 2007-03-24 19:05 /usr/bin/vi -> /etc/alternatives/vi $ sudo update-alternatives --display vi ... $ sudo update-alternatives --config vi Selection Command ---------------------------------------------- 1 /usr/bin/vim *+ 2 /usr/bin/nvi Enter to keep the default[*], or type selection number: 1
The Debian alternatives system keeps its selection as symlinks in
"/etc/alternatives/
". The selection process uses
corresponding file in "/var/lib/dpkg/alternatives/
".
Stat overrides provided by the
dpkg-statoverride
(8) command are a way to tell
dpkg
(1) to use a different owner or mode for a file when a package is installed. If
"--update
" is specified and file exists, it is
immediately set to the new owner and mode.
![]() |
Perhatian |
---|---|
The direct alteration of owner or mode for a file owned by the package using
|
![]() |
Catatan |
---|---|
I use the word file here, but in reality
this can be any filesystem object that |
File diversions provided by the
dpkg-divert
(8) command are a way of forcing
dpkg
(1) not to install a file into its default location,
but to a diverted location. The use of
dpkg-divert
is meant for the package maintenance
scripts. Its casual use by the system administrator is deprecated.
When running unstable
system, the administrator is
expected to recover from broken package management situation.
![]() |
Perhatian |
---|---|
Some methods described here are high risk actions. You have been warned! |
If a desktop GUI program experienced instability after significant upstream version upgrade, you should suspect interferences with old local configuration files created by it. If it is stable under a newly created user account, this hypothesis is confirmed. (This is a bug of packaging and usually avoided by the packager.)
To recover stability, you should move corresponding local configuration files and restart the GUI program. You may need to read old configuration file contents to recover configuration information later. (Do not erase them too quickly.)
Archive level package management systems, such as
aptitude
(8) or apt-get
(1), do not even
try to install packages with overlapped files using package dependencies
(see Bagian 2.1.6, “Dependensi paket”).
Errors by the package maintainer or deployment of inconsistently mixed
source of archives (see Bagian 2.7.2, “Packages from mixed source of archives”) by the system
administrator may create a situation with incorrectly defined package
dependencies. When you install a package with overlapped files using
aptitude
(8) or apt-get
(1) under such a
situation, dpkg
(1) which unpacks package ensures to
return error to the calling program without overwriting existing files.
![]() |
Perhatian |
---|---|
The use of third party packages introduces significant system risks via
maintainer scripts which are run with root privilege and can do anything to
your system. The |
You can work around such broken installation by removing the old offending
package, old-package
, first.
$ sudo dpkg -P old-package
When a command in the package script returns error for some reason and the script exits with error, the package management system aborts their action and ends up with partially installed packages. When a package contains bugs in its removal scripts, the package may become impossible to remove and quite nasty.
For the package script problem of
"package_name
", you should look into
following package scripts.
"/var/lib/dpkg/info/nama_paket.preinst
"
"/var/lib/dpkg/info/nama_paket.postinst
"
"/var/lib/dpkg/info/nama_paket.prerm
"
"/var/lib/dpkg/info/nama_paket.postrm
"
Edit the offending package script from the root using following techniques.
disable the offending line by preceding "#
"
force to return success by appending the offending line with "||
true
"
Configure all partially installed packages with the following command.
# dpkg --configure -a
Since dpkg
is very low level package tool, it can
function under the very bad situation such as unbootable system without
network connection. Let's assume foo
package was broken
and needs to be replaced.
You may still find cached copies of older bug free version of
foo
package in the package cache directory:
"/var/cache/apt/archives/
". (If not, you can download it
from archive of https://snapshot.debian.org/ or copy
it from package cache of a functioning machine.)
If you can boot the system, you may install it by the following command.
# dpkg -i /path/to/foo_old_version_arch.deb
![]() |
Tip |
---|---|
If system breakage is minor, you may alternatively downgrade the whole system as in Bagian 2.7.10, “Emergency downgrading” using the higher level APT system. |
If your system is unbootable from hard disk, you should seek other ways to boot it.
Boot the system using the debian-installer CD in rescue mode.
Mount the unbootable system on the hard disk to
"/target
".
Install older version of foo
package by the following.
# dpkg --root /target -i /path/to/foo_old_version_arch.deb
This example works even if the dpkg
command on the hard
disk is broken.
![]() |
Tip |
---|---|
Any GNU/Linux system started by another system on hard disk, live GNU/Linux CD, bootable USB-key drive, or netboot can be used similarly to rescue broken system. |
If attempting to install a package this way fails due to some dependency
violations and you really need to do this as the last resort, you can
override dependency using dpkg
's
"--ignore-depends
", "--force-depends
"
and other options. If you do this, you need to make serious effort to
restore proper dependency later. See dpkg
(8) for details.
![]() |
Catatan |
---|---|
If your system is seriously broken, you should make a full backup of system to a safe place (see Bagian 10.2, “Backup and recovery”) and should perform a clean installation. This is less time consuming and produces better results in the end. |
If "/var/lib/dpkg/status
" becomes corrupt for any reason,
the Debian system loses package selection data and suffers severely. Look
for the old "/var/lib/dpkg/status
" file at
"/var/lib/dpkg/status-old
" or
"/var/backups/dpkg.status.*
".
Keeping "/var/backups/
" in a separate partition may be a
good idea since this directory contains lots of important system data.
For serious breakage, I recommend to make fresh re-install after making
backup of the system. Even if everything in "/var/
" is
gone, you can still recover some information from directories in
"/usr/share/doc/
" to guide your new installation.
Reinstall minimal (desktop) system.
# mkdir -p /path/to/old/system
Mount old system at "/path/to/old/system/
".
# cd /path/to/old/system/usr/share/doc # ls -1 >~/ls1.txt # cd /usr/share/doc # ls -1 >>~/ls1.txt # cd # sort ls1.txt | uniq | less
Then you are presented with package names to install. (There may be some
non-package names such as "texmf
".)
Anda dapat mencari paket yang memenuhi kebutuhan Anda dengan
aptitude
dari deskripsi paket atau dari daftar di bawah
"Tugas".
When you encounter more than 2 similar packages and wonder which one to install without "trial and error" efforts, you should use some common sense. I consider following points are good indications of preferred packages.
Essential: yes > no
Area: main > contrib > non-free
Priority: required > important > standard > optional > extra
Tasks: packages listed in tasks such as "Desktop environment"
Packages selected by the dependency package (e.g., gcc-10
by gcc
)
Popcon: higher in the vote and install number
Changelog: regular updates by the maintainer
BTS: No RC bugs (no critical, no grave, and no serious bugs)
BTS: responsive maintainer to bug reports
BTS: higher number of the recently fixed bugs
BTS: lower number of remaining non-wishlist bugs
Debian being a volunteer project with distributed development model, its archive contains many packages with different focus and quality. You must make your own decision what to do with them.
![]() |
Perhatian |
---|---|
Installing packages from mixed source of archives is not supported by the
official Debian distribution except for officially supported particular
combinations of archives such as |
Here is an example of operations to include specific newer upstream version
packages found in unstable
while tracking
testing
for single occasion.
Change the "/etc/apt/sources.list
" file temporarily to
single "unstable
" entry.
Run "aptitude update
".
Run "aptitude install package-name
".
Recover the original "/etc/apt/sources.list
" file for
testing
.
Run "aptitude update
".
You do not create the "/etc/apt/preferences
" file nor
need to worry about apt-pinning with this manual approach. But this is very
cumbersome.
![]() |
Perhatian |
---|---|
When using mixed source of archives, you must ensure compatibility of packages by yourself since the Debian does not guarantee it. If package incompatibility exists, you may break system. You must be able to judge these technical requirements. The use of mixed source of random archives is completely optional operation and its use is not something I encourage you to use. |
General rules for installing packages from different archives are the following.
Non-binary packages ("Architecture: all
") are safer to install.
documentation packages: no special requirements
paket program interpreter: interpreter yang kompatibel harus tersedia
Binary packages (non "Architecture: all
") usually face
many road blocks and are unsafe to
install.
![]() |
Catatan |
---|---|
In order to make a package to be safer to install, some commercial non-free binary program packages may be provided with completely statically linked libraries. You should still check ABI compatibility issues etc. for them. |
![]() |
Catatan |
---|---|
Except to avoid broken package for a short term, installing binary packages from officially unsupported archives is generally bad idea. This is true even if you use apt-pinning (see Bagian 2.7.3, “Tweaking candidate version”). You should consider chroot or similar techniques (see Bagian 9.11, “Sistem tervirtualisasi”) to run programs from different archives. |
![]() |
Awas |
---|---|
Use of apt-pinning by a novice user is sure call for major troubles. You must avoid using apt-pinning except when you absolutely need it. |
Without the "/etc/apt/preferences
" file, APT system
choses the latest available version as the candidate
version using the version string. This is the normal state and
most recommended usage of APT system. All officially supported combinations
of archives do not require the "/etc/apt/preferences
"
file since some archives which should not be used as the automatic source of
upgrades are marked as NotAutomatic and
dealt properly.
![]() |
Tip |
---|---|
The version string comparison rule can be verified with, e.g.,
" |
When you install packages from mixed source of archives (see Bagian 2.7.2, “Packages from mixed source of archives”) regularly, you can
automate these complicated operations by creating the
"/etc/apt/preferences
" file with proper entries and
tweaking the package selection rule for candidate
version as described in apt_preferences
(5).
This is called apt-pinning.
![]() |
Perhatian |
---|---|
When using apt-pinning, you must ensure compatibility of packages by yourself since the Debian does not guarantee it. The apt-pinning is completely optional operation and its use is not something I encourage you to use. |
![]() |
Perhatian |
---|---|
Archive level Release files (see Bagian 2.5.3, “Berkas "Release" tingkat arsip”) are used for the rule of
|
![]() |
Perhatian |
---|---|
When you use non-Debian archive as a part of apt-pinning, you should check what they are intended for and also check their credibility. For example, Ubuntu and Debian are not meant to be mixed. |
![]() |
Catatan |
---|---|
Even if you do not create the " |
Here is a simplified explanation of apt-pinning technique.
The APT system choses the highest Pin-Priority upgrading package from available package sources
defined in the "/etc/apt/sources.list
" file as the
candidate version package. If the
Pin-Priority of the package is larger than 1000, this version restriction
for upgrading is dropped to enable
downgrading (see Bagian 2.7.10, “Emergency downgrading”).
Pin-Priority value of each package is defined by "Pin-Priority" entries in
the "/etc/apt/preferences
" file or uses its default
value.
Tabel 2.18. List of notable Pin-Priority values for apt-pinning technique.
Pin-Priority | apt-pinning effects to the package |
---|---|
1001 | install the package even if this constitutes a downgrade of the package |
990 | used as the default for the target release archive |
500 | used as the default for the normal archive |
100 | used as the default for the NotAutomatic and ButAutomaticUpgrades archive |
100 | used for the installed package |
1 | used as the default for the NotAutomatic archive |
-1 | never install the package even if recommended |
The target release archive can be set by several methods.
"/etc/apt/apt.conf
" configuration file with
"APT::Default-Release "stable";
" line
command line option, e.g., "apt-get install -t testing
some-package
"
The NotAutomatic and ButAutomaticUpgrades archive is set by archive
server having its archive level Release file (see Bagian 2.5.3, “Berkas "Release" tingkat arsip”) containing both
"NotAutomatic: yes
" and "ButAutomaticUpgrades:
yes
". The NotAutomatic archive
is set by archive server having its archive level Release file containing
only "NotAutomatic: yes
".
The apt-pinning situation of
package from multiple archive sources is displayed by
"apt-cache policy package
".
A line started with "Package pin:
" lists the package
version of pin if association just with
package is defined, e.g., "Package pin:
0.190
".
No line with "Package pin:
" exists if no association just
with package is defined.
The Pin-Priority value associated just with package is
listed right side of all version strings, e.g., "0.181
700
".
"0
" is listed right side of all version strings if no
association just with package is defined, e.g.,
"0.181 0
".
The Pin-Priority values of archives (defined as "Package:
*
" in the "/etc/apt/preferences
" file) are
listed left side of all archive paths, e.g., "100
http://deb.debian.org/debian/ bullseye-backports/main
Packages
".
There are bullseye-updates and backports.debian.org archives which
provide updgrade packages for stable
(bullseye
).
In order to use these archives, you list all required archives in the
"/etc/apt/sources.list
" file as the following.
deb http://deb.debian.org/debian/ bullseye main contrib non-free deb http://security.debian.org/ bullseye-security main contrib deb http://deb.debian.org/debian/ bullseye-updates main contrib non-free deb http://deb.debian.org/debian/ bullseye-backports main contrib non-free
There is no need to set Pin-Priority value explicitly in the
"/etc/apt/preferences
" file. When newer packages become
available, the default configuration provides most reasonable upgrades (see
Bagian 2.5.3, “Berkas "Release" tingkat arsip”).
All installed older packages are upgraded to newer ones from
bullseye-updates
.
Only manually installed older packages from
bullseye-backports
are upgraded to newer ones
from bullseye-backports
.
Whenever you wish to install a package named
"package-name
" with its dependency
from bullseye-backports
archive manually, you
use following command while switching target release with
"-t
" option.
$ sudo apt-get install -t bullseye-backports package-name
![]() |
Awas |
---|---|
Use of apt-pinning by a novice user is sure call for major troubles. You must avoid using apt-pinning except when you absolutely need it. |
If you wish not to pull in particular packages automatically by
"Recommends", you must create the "/etc/apt/preferences
"
file and explicitly list all those packages at the top of it as the
following.
Package: package-1 Pin: version * Pin-Priority: -1 Package: package-2 Pin: version * Pin-Priority: -1
![]() |
Awas |
---|---|
Use of apt-pinning by a novice user is sure call for major troubles. You must avoid using apt-pinning except when you absolutely need it. |
Here is an example of apt-pinning
technique to include specific newer upstream version packages found in
unstable
regularly upgraded while tracking
testing
. You list all required archives in the
"/etc/apt/sources.list
" file as the following.
deb http://deb.debian.org/debian/ testing main contrib non-free deb http://deb.debian.org/debian/ unstable main contrib non-free deb http://security.debian.org/ testing-security main contrib
Set the "/etc/apt/preferences
" file as the following.
Package: * Pin: release a=unstable Pin-Priority: 100
When you wish to install a package named
"package-name
" with its dependencies
from unstable
archive under this configuration, you issue
the following command which switches target release with
"-t
" option (Pin-Priority of unstable
becomes 990).
$ sudo apt-get install -t unstable package-name
With this configuration, usual execution of "apt-get
upgrade
" and "apt-get dist-upgrade
" (or
"aptitude safe-upgrade
" and "aptitude
full-upgrade
") upgrades packages which were installed from
testing
archive using current testing
archive and packages which were installed from unstable
archive using current unstable
archive.
![]() |
Perhatian |
---|---|
Be careful not to remove " |
![]() |
Tip |
---|---|
I usually edit the " |
![]() |
Tip |
---|---|
If " |
If you wish to track particular packages in unstable
automatically without initial "-t unstable
" installation,
you must create the "/etc/apt/preferences
" file and
explicitly list all those packages at the top of it as the following.
Package: package-1 Pin: release a=unstable Pin-Priority: 700 Package: package-2 Pin: release a=unstable Pin-Priority: 700
These set Pin-Priority value for each specific package. For example, in
order to track the latest unstable
version of this
"Debian Reference" in English, you should have following entries in the
"/etc/apt/preferences
" file.
Package: debian-reference-en Pin: release a=unstable Pin-Priority: 700 Package: debian-reference-common Pin: release a=unstable Pin-Priority: 700
![]() |
Tip |
---|---|
This apt-pinning technique is valid even when you are tracking
|
Here is another example of apt-pinning
technique to include specific newer upstream version packages found in
experimental
while tracking unstable
.
You list all required archives in the
"/etc/apt/sources.list
" file as the following.
deb http://deb.debian.org/debian/ unstable main contrib non-free deb http://deb.debian.org/debian/ experimental main contrib non-free deb http://security.debian.org/ testing-security main contrib
The default Pin-Priority value for experimental
archive
is always 1 (<<100) since it is NotAutomatic archive (see Bagian 2.5.3, “Berkas "Release" tingkat arsip”). There is no need to set
Pin-Priority value explicitly in the
"/etc/apt/preferences
" file just to use
experimental
archive unless you wish to track particular
packages in it automatically for next upgrading.
![]() |
Awas |
---|---|
Use of apt-pinning by a novice user is sure call for major troubles. You must avoid using apt-pinning except when you absolutely need it. |
The apt
package comes with its own cron script
"/etc/cron.daily/apt
" to support the automatic download
of packages. This script can be enhanced to perform the automatic upgrade
of packages by installing the unattended-upgrades
package. These can be customized by parameters in
"/etc/apt/apt.conf.d/02backup
" and
"/etc/apt/apt.conf.d/50unattended-upgrades
" as described
in "/usr/share/doc/unattended-upgrades/README
".
The unattended-upgrades
package is mainly intended for
the security upgrade for the stable
system. If the risk
of breaking an existing stable
system by the automatic
upgrade is smaller than that of the system broken by the intruder using its
security hole which has been closed by the security update, you should
consider using this automatic upgrade with configuration parameters as the
following.
APT::Periodic::Update-Package-Lists "1"; APT::Periodic::Download-Upgradeable-Packages "1"; APT::Periodic::Unattended-Upgrade "1";
If you are running an unstable
system, you do not want to
use the automatic upgrade since it certainly breaks system some day. Even
for such unstable
case, you may still want to download
packages in advance to save time for the interactive upgrade with
configuration parameters as the following.
APT::Periodic::Update-Package-Lists "1"; APT::Periodic::Download-Upgradeable-Packages "1"; APT::Periodic::Unattended-Upgrade "0";
If you want to limit the download bandwidth for APT to e.g. 800Kib/sec (=100kiB/sec), you should configure APT with its configuration parameter as the following.
APT::Acquire::http::Dl-Limit "800";
![]() |
Awas |
---|---|
Use of apt-pinning by a novice user is sure call for major troubles. You must avoid using apt-pinning except when you absolutely need it. |
![]() |
Perhatian |
---|---|
Downgrading is not officially supported by the Debian by design. It should be done only as a part of emergency recovery process. Despite of this situation, it is known to work well in many incidents. For critical systems, you should backup all important data on the system after the recovery operation and re-install the new system from the scratch. |
You may be lucky to downgrade from newer archive to older archive to recover
from broken system upgrade by manipulating candidate
version (see Bagian 2.7.3, “Tweaking candidate version”).
This is lazy alternative to tedious actions of many "dpkg -i
broken-package_old-version.deb
"
commands (see Bagian 2.6.4, “Rescue with the dpkg command”).
Search lines in the "/etc/apt/sources.list
" file tracking
unstable
as the following.
deb http://deb.debian.org/debian/ sid main contrib non-free
Replace it with the following to track testing
.
deb http://deb.debian.org/debian/ bookworm main contrib non-free
Set the "/etc/apt/preferences
" file as the following.
Package: * Pin: release a=testing Pin-Priority: 1010
Run "apt-get update; apt-get dist-upgrade
" to force
downgrading of packages across the system.
Remove this special "/etc/apt/preferences
" file after
this emergency downgrading.
![]() |
Tip |
---|---|
It is a good idea to remove (not purge!) as much packages to minimize dependency problems. You may need to manually remove and install some packages to get system downgraded. Linux kernel, bootloader, udev, PAM, APT, and networking related packages and their configuration files require special attention. |
Although the maintainer name listed in
"/var/lib/dpkg/available
" and
"/usr/share/doc/package_name/changelog
" provide some
information on "who is behind the packaging activity", the actual uploader
of the package is somewhat obscure. who-uploads
(1) in
the devscripts
package identifies the actual uploader of
Debian source packages.
If you are to compile a program from source to replace the Debian package,
it is best to make it into a real local debianized package
(*.deb
) and use private archive.
If you chose to compile a program from source and to install them under
"/usr/local
" instead, you may need to use
equivs
as a last resort to satisfy the missing package
dependency.
Package: equivs Priority: optional Section: admin Description: Circumventing Debian package dependencies This package provides a tool to create trivial Debian packages. Typically these packages contain only dependency information, but they can also include normal installed files like other packages do. . One use for this is to create a metapackage: a package whose sole purpose is to declare dependencies and conflicts on other packages so that these will be automatically installed, upgraded, or removed. . Another use is to circumvent dependency checking: by letting dpkg think a particular package name and version is installed when it isn't, you can work around bugs in other packages' dependencies. (Please do still file such bugs, though.)
For partial upgrades of the stable
system, rebuilding a
package within its environment using the source package is desirable. This
avoids massive package upgrades due to their dependencies.
Add the following entries to the "/etc/apt/sources.list
"
of a stable
system.
deb-src http://deb.debian.org/debian unstable main contrib non-free
Install required packages for the compilation and download the source package as the following.
# apt-get update # apt-get dist-upgrade # apt-get install fakeroot devscripts build-essential # apt-get build-dep foo $ apt-get source foo $ cd foo*
Update some tool chain packages such as dpkg
, and
debhelper
from the backport packages if they are required
for the backporting.
Jalankan hal-hal berikut.
$ dch -i
Bump package version, e.g. one appended with "+bp1
" in
"debian/changelog
"
Build packages and install them to the system as the following.
$ debuild $ cd .. # debi foo*.changes
Since mirroring whole subsection of Debian archive wastes disk space and
network bandwidth, deployment of a local proxy server for APT is desirable
consideration when you administer many systems on LAN. APT can be configure to use generic web (http)
proxy servers such as squid
(see Bagian 6.5, “Other network application servers”) as described in
apt.conf
(5) and in
"/usr/share/doc/apt/examples/configure-index.gz
". The
"$http_proxy
" environment variable can be used to
override proxy server setting in the "/etc/apt/apt.conf
"
file.
There are proxy tools specially for Debian archive. You should check BTS before using them.
Tabel 2.19. List of the proxy tools specially for Debian archive
paket | popcon | ukuran | deskripsi |
---|---|---|---|
approx
|
V:0, I:0 | 6317 | caching proxy server for Debian archive files (compiled OCaml program) |
apt-cacher
|
V:0, I:0 | 289 | Caching proxy for Debian package and source files (Perl program) |
apt-cacher-ng
|
V:5, I:5 | 1790 | Caching proxy for distribution of software packages (compiled C++ program) |
![]() |
Perhatian |
---|---|
When Debian reorganizes its archive structure, these specialized proxy tools tend to require code rewrites by the package maintainer and may not be functional for a while. On the other hand, generic web (http) proxy servers are more robust and easier to cope with such changes. |
You can learn more on the package management from following documentations.
Primary documentations on the package management:
aptitude
(8), dpkg
(1),
tasksel
(8), apt
(8),
apt-get
(8), apt-config
(8),
apt-key
(8), sources.list
(5),
apt.conf
(5), dan apt_preferences
(5);
"/usr/share/doc/apt-doc/guide.html/index.html
" and
"/usr/share/doc/apt-doc/offline.html/index.html
" from the
apt-doc
package; and
"/usr/share/doc/aptitude/html/en/index.html
" from the
aptitude-doc-en
package.
Official and detailed documentations on the Debian archive:
Tutorial for building of a Debian package for Debian users: