Note that some of the commands shown here must be installed before they can
be removed. For example, to use 'netselect', you must first (as root) do
'apt-get install netselect'.
| Function |
Command |
Example |
| Install package |
apt-get install packagename |
apt-get install xchat |
| Reinstall package |
apt-get --reinstall install packagename |
apt-get --reinstall install xchat |
| Redo the setup for a package |
dpkg-reconfigure packagename |
dpkg-reconfigure setserial |
| Install a package from a different Debian version |
apt-get -t dist install packagename |
apt-get -t stable install nautilus
|
| Install a specific version of a package |
apt-get install package=version-number |
apt-get install nautilus=2.2.4-1 |
| Install package source |
apt-get source packagename |
apt-get source xchat |
| Install package source and build it immediately |
apt-get -b source packagename |
apt-get -b source xchat |
| Install dependencies needed for building a package |
apt-get build-dep packagename |
apt-get build-dep xchat |
| Install an individual .deb file that has been manually downloaded |
dpkg -i filename |
dpkg -i mypackage.deb |
| Function |
Command |
Example |
| Remove a package and all packages that depend upon it, but leave configuration files in place |
apt-get remove packagename |
apt-get remove kdebase |
| Completely remove a package and all packages that depend upon it, including all the configuration files |
apt-get --purge remove packagename |
apt-get --purge remove kdebase |
| Completely remove an individual package, but leave its dependencies in
place |
dpkg --purge packagename |
dpkg --purge xchat |
| Remove old downloaded .deb files |
apt-get autoclean |
| Remove all downloaded .deb files |
apt-get clean |
| Remove unused locales |
localepurge |
| Show the libraries that can be removed because they are no longer
needed |
deborphan |
| Show the packages that can be removed in a single step because they have
no dependencies |
deborphan -all-packages |
| Function |
Command |
Example |
| Find packages with certain words in their description |
apt-cache search first-word second-word... |
apt-cache search puzzle game |
| Show the description of a package |
apt-cache show packagename |
apt-cache show xchat |
| Show general information about a package |
apt-cache showpkg packagename |
apt-cache showpkg kworldclock |
| Show the dependencies of a package |
apt-cache depends packagename |
apt-cache depends kworldclock |
| List the contents of a package |
apt-file list packagename |
apt-file list penguineyes
|
| Find a package that contains a specific file |
apt-file search filename
|