– General Linux 1 – (Linux Professional Institute Certification) 102-2 Use Debian Package management [5] a .˜. /V\ // \\ @._.@ by: geoffrey robertson geoffrey@zip.com.au $Id: 102-5.tex,v 1.2 2003/05/30 06:06:18 waratah Exp $ c 2002 Geoffrey Robertson. Permission is granted to make and distribute verbatim copies or modified versions of this document provided that this copyright notice and this permission notice are preserved on all copies under the terms of the GNU General Public License as published by the Free Software Foundation—either version 2 of the License or (at your option) any later version. a Copyright 1 List of Slides 1 – Use Debian Package Management . . . . . . . . . . . . . . . . . 3 1.1 – Objective . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.2 – Key files, terms and utilities . . . . . . . . . . . . . . . . . . 4 1.3 – Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 2 – Debian Packages—debs . . . . . . . . . . . . . . . . . . . . . . 5 3 – Using dpkg . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 3.1 – Installing Packages Using dpkg . . . . . . . . . . . . . . . . 7 3.2 – Install Dependencies Using dpkg . . . . . . . . . . . . . . . 8 3.3 – Force options for dpkg . . . . . . . . . . . . . . . . . . . . . 9 3.4 – Removing Packages Using dpkg . . . . . . . . . . . . . . . . 10 3.5 – Removing Packages with Dependencies Using dpkg . . . . . 11 2 3.6 – Purging Packages Using dpkg . . . . . . . . . . . . . . . . . 12 3.7 – Querying Packages Using dpkg . . . . . . . . . . . . . . . . 13 3.8 – Listing Packages Using dpkg . . . . . . . . . . . . . . . . . 15 3.9 – Showing Package Status Using dpkg . . . . . . . . . . . . . 16 3.10 – . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 4 – dselect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 5 – apt-get . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 6 – apt-cache . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 7 – alien . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 3 Use Debian Package Management Objective Candidates should be able to perform Debian package management. This objective includes being able to use command-line and interactive tools to install, upgrade, or uninstall packages, as well as find packages containing specific files or software (such packages might or might not be installed). This objective also includes being able to obtain package information like version, content, dependencies, package integrity and installation status (whether or not the package is installed). 4 Key files, terms and utilities • /etc/dpkg/dpkg.cfg • /var/lib/dpkg/* • /etc/apt/apt.conf • dpkg • dselect • apt-get • alien • /etc/apt/sources.list • dpkg-reconfigure Resources The Debian GNU/Linux FAQ : http://www.debian.org/doc/FAQ/index.html 5 √ • • • • • • Use Debian Package Management . . . . . . . . . . Debian Packages—debs . . . . . . . . . . . . . . . Using dpkg . . . . . . . . . . . . . . . . . . . . . dselect . . . . . . . . . . . . . . . . . . . . . . . . apt-get . . . . . . . . . . . . . . . . . . . . . . . . apt-cache . . . . . . . . . . . . . . . . . . . . . . . alien . . . . . . . . . . . . . . . . . . . . . . . . . . 3 5 6 18 19 20 21 ⇒• 6 Debian Packages—debs General format: package_version-build architecture.deb Example deb: disc-cover 1.0.1-3.deb Task Packages Package containing only a large number of dependencies. Used to install a software bundle. Task Package Example: kde 2.2.25 all.deb 7 √ √ • • Use Debian Package Management . . . . . . . . . . Debian Packages—debs . . . . . . . . . . . . . . . Using dpkg . . . . . . . . . . . . . . . . . . . . . Installing Packages Using dpkg Install Dependencies Using dpkg Force options for dpkg Removing Packages Using dpkg Removing Packages with Dependencies Using dpkg Purging Packages Using dpkg Querying Packages Using dpkg Listing Packages Using dpkg Showing Package Status Using dpkg 8 3 5 6 ⇒• • • • • dselect . . . . . . . . . . . . . . . . . . . . . . . . apt-get . . . . . . . . . . . . . . . . . . . . . . . . apt-cache . . . . . . . . . . . . . . . . . . . . . . . alien . . . . . . . . . . . . . . . . . . . . . . . . . . 18 19 20 21 9 Using dpkg dpkg is the core Debian package tool. 10 Installing Packages Using dpkg To install a package : or # dpkg --install bpalogin_2.0-1.deb ← Example : # dpkg -i bpalogin_2.0-1.deb ← # dpkg -i bpalogin_2.0-1.deb ← Selecting previously deselected package bpalogin. (Reading database ... 110224 files and directories currently installed.) Unpacking bpalogin (from bpalogin_2.0-1.deb) ... Setting up bpalogin (2.0-1) ... Starting bpalogin: bpalogin. 11 Install Dependencies Using dpkg 12 Force options for dpkg 13 Removing Packages Using dpkg Removing a package does not remove any configuration files. To remove a package : or # dpkg --remove bpalogin ← Example : # dpkg -r bpalogin ← # dpkg -r bpalogin ← (Reading database ... 110235 files and directories currently installed.) Removing bpalogin ... Stopping bpalogin: bpalogin. 14 Removing Packages with Dependencies Using dpkg 15 Purging Packages Using dpkg Purging a package removes all configuration files. To purge a package : or (notice the Upper case P) Example : # dpkg --purge bpalogin ← # dpkg -P bpalogin ← # dpkg -P bpalogin ← (Reading database ... 110235 files and directories currently installed.) Removing bpalogin ... Stopping bpalogin: bpalogin. 16 Querying Packages Using dpkg To purge a package : or (notice the lower case p) # dpkg --print-avail bpalogin ← # dpkg -p bpalogin ← 17 Package Query Example : # dpkg -p bpalogin ← Package: bpalogin Priority: extra Section: net Installed-Size: 120 Maintainer: Robert Graham Merkel Architecture: i386 Version: 2.0-1 Depends: libc6 (>= 2.1.94) Recommends: dhcp-client Size: 15306 Description: Login client for Telstra(TM) BPA cable users This daemon lets Telstra(TM) Big Pond(TM) Advance(TM) cable customers log in to their accounts. It uses the BIDS2 protocol. Please note that this client is not officially supported by Telstra. . You need some kind of DHCP client to use the service. 18 Listing Packages Using dpkg To purge a package : or # dpkg --list apache* ← # dpkg -l apache* ← Example : # dpkg -l apache* ← Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed |/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad) Version Description ||/ Name +++-================-================-================================================ ii apache 1.3.24-3 Versatile, high-performance HTTP server ii apache-common 1.3.24-3 Support files for all Apache webservers un apache-dev (no description available) un apache-doc (no description available) un apache-modules (no description available) un apache-perl (no description available) ii apache-ssl 1.3.24.3+1.48-2 Versatile, high-performance HTTP server with SSL 19 Showing Package Status Using dpkg To purge a package : or # dpkg --status package_name ← # dpkg -s package_name ← 20 Example of Package Status : # dpkg -s eterm ← Package: eterm Status: install ok installed Priority: optional Section: x11 Installed-Size: 1040 Maintainer: Laurence J. Lane Version: 0.9.1-2 Replaces: eterm-ml, eterm-backgrounds Provides: x-terminal-emulator, eterm-backgrounds Depends: ncurses-term, libast1, libc6 (>= 2.2.4-2), libimlib2, libttf2, xlibs (>> 4.1.0) Conflicts: eterm-backgrounds, eterm-ml Description: Enlightened Terminal Emulator A terminal emulator in the spirit of xterm or rxvt, eterm uses an Enlightenment style config file, as well as themes. The Imlib graphics engine is used to render images. This version supports background images, pixmapped scrollbars, pseudo-transparency, POSIX threads, and unicode support. 21 √ √ √ • • • • • • Use Debian Package Management . . . . . . . . . . Debian Packages—debs . . . . . . . . . . . . . . . Using dpkg . . . . . . . . . . . . . . . . . . . . . dselect . . . . . . . . . . . . . . . . . . . . . . . . apt-get . . . . . . . . . . . . . . . . . . . . . . . . apt-cache . . . . . . . . . . . . . . . . . . . . . . . alien . . . . . . . . . . . . . . . . . . . . . . . . . . 3 5 6 18 19 20 21 ⇒• 22 dselect 23 √ √ √ √ • • • • • • Use Debian Package Management . . . . . . . . . . Debian Packages—debs . . . . . . . . . . . . . . . Using dpkg . . . . . . . . . . . . . . . . . . . . . dselect . . . . . . . . . . . . . . . . . . . . . . . . apt-get . . . . . . . . . . . . . . . . . . . . . . . . apt-cache . . . . . . . . . . . . . . . . . . . . . . . alien . . . . . . . . . . . . . . . . . . . . . . . . . . 3 5 6 18 19 20 21 ⇒• 24 apt-get 25 apt-cache 26 √ √ √ √ √ √ • • • • • • Use Debian Package Management . . . . . . . . . . Debian Packages—debs . . . . . . . . . . . . . . . Using dpkg . . . . . . . . . . . . . . . . . . . . . dselect . . . . . . . . . . . . . . . . . . . . . . . . apt-get . . . . . . . . . . . . . . . . . . . . . . . . apt-cache . . . . . . . . . . . . . . . . . . . . . . . alien . . . . . . . . . . . . . . . . . . . . . . . . . . 3 5 6 18 19 20 21 ⇒• 27 alien 28 √ √ √ √ √ √ √ • • • • • • • Use Debian Package Management . . . . . . . . . . Debian Packages—debs . . . . . . . . . . . . . . . Using dpkg . . . . . . . . . . . . . . . . . . . . . dselect . . . . . . . . . . . . . . . . . . . . . . . . apt-get . . . . . . . . . . . . . . . . . . . . . . . . apt-cache . . . . . . . . . . . . . . . . . . . . . . . alien . . . . . . . . . . . . . . . . . . . . . . . . . . 3 5 6 18 19 20 21 29