Published in mydebian.blogdns.org - 09-07-2008
Here is an incomplete and badly sorted list of the most useful combinations of apt/dpkg I have been using lately.
Please remember that those command lines which start with a # need root pemissions.
Install/Remove
- Install a package from a repository:
# apt-get install package
- Install a package in the current directory:
# dpkg -i package
- Uninstall a package (keep config files)
# apt-get remove package
- Completely uninstall a package
# apt-get remove --purge package
Information
- Get the content of a deb package (you must have it somewhere)
$ dpkg -c package.deb
- Get description of a deb package (you must have it somewhere)
$ dpkg -f package.deb
- Get the description of a package
$ apt-cache showpkg package
- Print which packages a given package depends on
$ apt-cache depends package
- Print which packages depends on a given package
apt-cache rdepends package
- List installed packages
$ dpkg -l
- List contents of an installed package
$ dpkg -L package
- List description of an installed package
$ dpkg -s package
Search files/packages
Please, feel free to correct this list or add any other useful statement.