– General Linux 1 – Use Debian package management [5] (Linux Professional Institute Certification) a .˜. /V\ // \\ @._.@ Slides based on a talk by Jeff Waugh by: geoffrey robertson geoffrey@zip.com.au $Id: gl1.102.5.slides.tex,v 1.2 2003/05/30 05:09:04 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 2 (2.2) 102 Installation & Package Mgt. [24] 1.102.1 Design hard disk layout [2] 1.102.2 Install a boot manager [3] 1.102.3 Make and install programs from source [5] 1.102.4 Manage shared libraries [3] 1.102.5 Use Debian package management [5] 1.102.6 Use Red Hat Package Manager (RPM) [6] 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 Use Debian package management Key files, terms, and utilities /etc/dpkg/dpkg.cfg /var/lib/dpkg/* /etc/apt/apt.conf /etc/apt/sources.list dpkg dselect dpkg-reconfigure apt-get alien 5 Use Debian package management Resources of interest The Debian GNU/Linux FAQ : http://www.debian.org/doc/FAQ/index.html lcdp slides : gl1.102.5.slides.tex Quick Reference for Debian GNU/Linux : http://qref.sourceforge.net/ 6 Debian Package Management Overview Basic tool—dpkg dpkg is the back end for all Debian package management. Old Menu System—dselect ncurses menu system for dselect—bizarre interface. The Ultimate Package Tool—apt-get “Once you’ve been spoiled by the apt thing you just can’t go back.” 7 Debian Package Management Tool—dpkg • Basic package management: installation, removal, extraction and building. • Does not handle or fulfil dependencies, that’s left for higher level software such as apt. 8 Debian Package Management Tool—dpkg Tasks • Install a package: dpkg -i • Remove a package: dpkg -r • Purge a package: dpkg -P • Find out which files a package owns: dpkg -L • Find out which package a file belongs to: dpkg -S • Extract information from package: dpkg -e • List contents of package file: dpkg -c 9 Debian Package Management Tool—dpkg /etc/dpkg/dpkg.cfg • Configuration file for dpkg(1) • Each line contains a single option which is exactly the same as a normal command line option for dpkg except for the leading dashes. Hashes for comments. • See ’man dpkg’ or ’dpkg –help’ for commands. 10 Debian Package Management Tool—dpkg /etc/dpkg/dpkg.cfg • Example: # dpkg configuration file # # This file can contain default options for dpkg. # All commandline options are allowed. Values can # be specific by putting them after the option, # separated by whitespace and/or an ‘=’ sign. # no-debsig abort-after 2 no-act 11 Debian Package Mgt. Tool—dpkg /var/lib/dpkg/* • Package management status and system files, generally not directly manipulated. • Most important files: alternatives: Contains files that define and store configuration for the command alternatives on the system. (Good examples: editor and x-window-manager.) available: Information about packages available to the system, retrieved from every specified sources. (See also: grep-available.) status: Information about packages installed on, or removed from your system. 12 Debian Package Mgt. Utility—apt-get apt-get Dependency resolving package management utility. 13 Debian Package Mgt. Utility—apt-get /etc/apt/apt.conf • Configuration files for apt(1). • apt.conf used by administrator for unique system configurations. • Example: Setting apt’s HTTP proxy: Acquire::http "http://192.168.10.1/"; • apt.conf.d managed by software that integrates with apt, such as our examples: dpkg-reconfigure and apt-listchanges. • See ’man apt.conf’ for configuration directives and format. • apt-config(1) is useful for troubleshooting apt.conf problems. 14 Debian Package Mgt. Utility—apt-get 15 Debian Package Mgt. Utility—apt-get /etc/apt/sources.list • Administrator-configured list of package repositories used by apt. • Numerous retrieval methods: file, cdrom, http, ftp, copy, rsh and ssh. • Many repositories exist for developers, specific software, other distributions, etc. • Example: deb deb deb deb http://mirror.aarnet.edu.au/debian woody main contrib non-free file:/mnt/devserver/packages woody main contrib non-free http://user:pass@example.com/path distro section section ssh://user@example.com/path distro section section 16 Debian Package Mgt. Utility—deselect dselect • Hideous! Ugh! Run for your lives! • Original frontend to apt/dpkg. • Subject of many jokes: ”All package managers feature creep until they’re as complicated and horrible as dselect.” ”Debian’s extensive features provide not only to ability shoot yourself in the foot, but to blow off each toe individually.” • Offers more help than apt-get, but is incredibly baroque and hard to use. 17 Debian Package Mgt. Utility—deselect 18 The Debian Configuration System 19 dpkg-reconfigure 20 Debian Package Conversion Utility—alien Theory : ”alien is a program that converts between Redhat rpm, Debian deb, Stampede slp, Slackware tgz, and Solaris pkg file formats. If you want to use a package from another linux distribution than the one you have installed on your system, you can use alien to convert it to your preferred package format and install it. It also supports LSB packages.” Reality : • You are completely bat shit insane, and/or, • You are using proprietary software. Useful for quick stuff, or pulling apart RPMs and SRPMs without too much hassle. 21 The End 22