Useful apt commands (Ubuntu, Debian, Mint etc.)

Terminal commands for package management can be an essential thing if you come across an unexpected error or are just interested in how things work. Here are a few of the more important ones:


apt-cache search --names-only --installed

Followed by a pattern, the above command searches every package in its cache for it (you can leave or add the given options starting with --).

apt-cache showpkg

Followed by a package name, this command gives you basic information about it, e.g version number, dependencies...

apt-cache stats

This command gives basic statistics about your package cache.

apt-cache depends

Followed by a package name, this command gives you all of the package's dependencies.

apt-cache unmet

This command gives you a list of unmet dependencies.

cat /etc/apt/sources.list

Gives you a list of your repositories. The file can also be opened with a text editor to be edited.

ls /etc/apt/sources.list.d

Shows the contents of the given directory, where your installed ppa are stored in.

Leave a Comment