– General Linux 1 –

Use Debian package management [5]

(Linux Professional Institute Certification)

a

   .~.      Slides based on a talk by Jeff Waugh
   /V\      by: geoffrey robertson
  // \\         geoffrey@zip.com.au
  @._.@
$Id: gl1.102.5.slides.tex,v 1.2 2003/05/30 05:09:04 waratah Exp $

aCopyright \begin{matrix}c \\ ◯ \end{matrix} 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.

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]

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).

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

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/

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.”

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.

Debian Package Management Tool—dpkg

Tasks

• Install a package: dpkg -i <package-file>
• Remove a package: dpkg -r <package-name>
• Purge a package: dpkg -P <package-name>

• Find out which files a package owns: dpkg -L <package-name> • Find out which package a file belongs to: dpkg -S <file-name> • Extract information from package: dpkg -e <package-file> • List contents of package file: dpkg -c <package-file>

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.

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

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.

Debian Package Mgt. Utility—apt-get

 apt-get

Dependency resolving package management utility.

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.

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 http://mirror.aarnet.edu.au/debian woody main contrib non-free
deb file:/mnt/devserver/packages woody main contrib non-free
deb http://user:pass@example.com/path distro section section
deb ssh://user@example.com/path distro section section

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.

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.

The End

22