APT tricks for forgetful debian/ubuntu users

To update your package list

apt-get update

To simulate what would happen if you upgrade/install a package with –dry-run or -s

apt-get install --dry-run <pkgname>

To download only a package without installing it with –download-only or -d

apt-get install --download-only <pkgname>

Re-install a package that is already installed and at the newest version

apt-get install --reinstall <pkgname>

To upgrade a single package, and only if it is installed.

apt-get install --only-upgrade <pkgname>

To do keyword-based package searches

apt-cache search <keyword>

To display the description, the headers, the dependencies of a package:

apt-cache show <pkgname>

To show the priority selection of the package (the installed and the repo versions)

apt-cache policy <pkgname>

To show all the installed files of a package use

dpkg-query -L <pkgname>


dpkg --listfiles <pkgname>
notes/apt-trick.txt · Last modified: 2014/11/02 06:47 by admin
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Run by Debian Driven by DokuWiki