Debian/Ubuntu Packages

I do a lot of work with the debian/ubuntu packagemanagement apt and aptitude with all it’s amazing options and subcommands.

Here I just write some of them, I really often need and use. All commands must run as root. So insert a sudo at the beginning of the command or just run it as user root. [TOC]

update package repository

apt-get update

search package

apt-cache search PACKAGE_NAME|regex

show informations

apt-cache show PACKAGE_NAME
apt-cache showpkg PACKAGE_NAME

get sources

apt-get source PACKAGE_NAME

install package

apt-get install PACKAGE_NAME
apt-get install --reinstall PACKAGE_NAME

remove package

apt-get remove PACKAGE_NAME
apt-get install --purge PACKAGE_NAME

upgrade packages

apt-get -u upgrade

upgrade distribution

apt-get -u dist-upgrade 

remove not used packages

apt-get clean
apt-get autoclean

show installed package version

apt-show-versions -p PACKAGE_NAME
apt-cache policy PACKAGE_NAME 

apt-show-versions is a seperate package which can be installed.


apt-cache depends PACKAGE_NAME
apt-cache rdepends PACKAGE_NAME
apt-cache --recurse depends PACKAGE_NAME

graph dependencies

apt-rdepends --dotty PACKAGE_NAME|dot -Tpng > FILE

apt-rdepends is a seperate package which can be installed.

which package installed file in filesystem

dpkg -S FILE

which files are installed by package


list all installed packages

dpkg -l
comments powered by Disqus