Debian packagemanagement

Information howto create your own debian package can be found here

Frequently used tasks:

aptitude

search for installed packages containing apache

aptitude search apache | grep ^i

purge configuration files of removed packages

aptitude purge '~c'

apt-cache

Search for packages containing the word bridge

apt-cache search bridge

Show the description of a package:

apt-cache show bridge-utils

apt-get

Install (security) updates:

apt-get update
apt-get --show-upgraded upgrade

This will update the apt repository and show wich packages are to be updated

backports.org

Howto integrate backports into the etch-release. For the official description see http://www.backports.org/dokuwiki/doku.php?id=instructions

echo "deb http://www.backports.org/debian etch-backports main contrib non-free" >> /etc/apt/sources.list
apt-get update
apt-get install debian-backports-keyring

Install your favourite backported package as follows:

aptitude -t etch-backports install “package”

A useful tool to investigate which packages are upgradable is apt-show-versions:

~# apt-show-versions --package=puppet
puppet/etch uptodate 0.24.4-8~bpo40+1

~# apt-show-versions --upgradeable
mutt/etch upgradeable from 1.5.13-1.1etch1 to 1.5.18-2~bpo40+1

deborphan

The man page reads: finds packages that have no packages depending on them. The default operation is to search only within the libs and oldlibs sections to hunt down unused libraries.

deborphan | xargs dpkg --purge

This command line will purge libs found by deborpan.

dpkg

Save package selections to file:

dpkg --get-selections '*' > ~/dpkg_packages

Restore selections:

dpkg --set-selections < ~/dpkg_packages
apt-get dselect-upgrade

Install a package:

dpkg -i packagename
dpkg --install packagename

Query .deb file

dpkg-deb --info foo.deb
dpkg-deb --contents foo.deb

List all files in a package:

dpkg -L packagename
dpkg --listfiles packagename

Query an (installed) package:

dpkg -s packagename
dpkg --status packagename

Remove a package, leaving the config files in place:

dpkg -r packagename
dpkg --remove packagename

Purge a package with ALL config files:

dpkg -P packagename
dpkg --purge packagename

Search package to which a given file belongs:

dpkg -S pattern
dpkg --search pattern

check architecture (amd64, i386, …):

dpkg --print-architecture

netselect-apt

netselect-apt is a helper to find a suitable mirror to download your packages from.

FAQ

  • There are no public key available for the following key IDs …

Solution:

 apt-get update && apt-get install debian-archive-keyring && apt-get update
debian/packagemanagement.txt · Last modified: 2011/08/25 17:09 by tb
CC Attribution-Noncommercial-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0