$Id: debian.txt 1889 2008-08-18 21:46:56Z mjs $

HOWTO: Find/search for packages to install

$ apt-cache search <package>

HOWTO: Install a package

$ sudo apt-get install <package>

HOWTO: Remove/uninstall a package

$ sudo apt-get remove <package>

HOWTO: Update the package list

Many (most?) of the operations listed here operate on the local package cache; the following instruction updates the cache.

$ sudo apt-get update

(Running this command may be necessary if, for example apt-get update complains about packages not found.)

HOWTO: Clean the downloaded package cache

All the downloaded packages are stored in /var/cache/apt/archives; to clean this out do:

$ sudo apt-get clean

HOWTO: Upgrade outdated packages

$ sudo apt-get -u upgrade

-u to show which packages will be upgraded, and allow you to confirm whether you want to upgrade them or not. (It seems that "upgrade" will upgrade to a new distribution.)

More information.

HOWTO: List outdated packages

$ apt-show-versions -u

Note: you may need to install the "apt-show-versions" package first.

HOWTO: List currently-installed packages

$ dpkg -l

Note: if you're looking for a convenient way to backup and restore your current system, you can do:

# backup
$ sudo dpkg --get-selections > pkglist

# restore
$ sudo dpkg --set-selections < pkglist
$ sudo apt-get dselect-upgrade 

HOWTO: Get information about a package

The following shows brief description dependencies, version, maintainer, etc.:

$ apt-cache show <package>

To see the files installed by a package, use (really slow!):

$ apt-file list <package>

Note: you may need to install the "apt-file" package first!

HOWTO: List the files installed by a package (i.e. package contents)

$ apt-file list <package>

... though this may not be up to date; update the database with:

$ sudo apt-file update

Note: you may need to install the apt-file package first!

HOWTO: Determine package dependencies

$ apt-cache depends <package>

HOWTO: Determine which package a particular file came from

$ dpkg -S <filename>

HOWTO: Determine which package will provide/install a particular file

# substring anywhere
$ apt-file search <filename>

# substring in basename 
$ apt-file -F search <filename>      

# regexp anywhere 
$ apt-file -x search <filename>      

# exact basename
$ apt-file -x search '\/<filename>$' 

Note: you may need to install the apt-file package first!

This command takes a long time to run; the web version may be faster.

FAQ: How can I search for packages?

Apart from the command-line tools, you can use:

http://packages.debian.org/
http://packages.ubuntu.com/

FAQ: Where's killall?

It's in the package psmisc.

FAQ: Where's dig?

It's in the package dnsutils.

FAQ: Where's apachectl?

It's probably called apache2ctl.

FAQ: How do I find out what services I'm running? (Network and non-network.)

???

FAQ: How do I set up a firewall?

??? Do you need to? This is supposedly much easier in 8.04, which incorporates ufw.

HOWTO: Monitor network traffic

$ sudo iftop

As documented in the manpage, by default this will show DNS lookups--turn these off with the -n option, or filter them out with the "not port domain" filter.

ERROR: "The following packages have been kept back"

There's some dependency problem, or something. The official solution seems to be to get apt to try harder:

$ sudo apt-get -u dist-upgrade

TIP: Ubuntu JeOS Bootstrap

$ apt-get install build-essential           # packages necessary for compiling
$ apt-get install linux-headers-$(uname -r) # headers for existing build

Install the VMware tools. First select Virtual Machine | Install VMware Tools to make a virtual CD available, then:

$ mount /dev/cdrom /cdrom
$ cd /tmp
$ tar xfz /mnt/VMwareTools*
$ /tmp/vmware-tools-distrib/vmware-install.pl

The installation of the kernel module may fail. To fix this, run the

Installing the Open VM Tools:

You need to install some package; most can be deduced from the error messages generated by configure, but if it asks for dnet-config, you need to install the libdumbnet-dev package (not libdnet-dev).

FAQ: How can I add the "universe" and "multiverse" repositories?

See Adding the Universe and Multiverse Repositories.