Skip to content

This document is a WORK IN PROGRESS.
This is just a quick personal cheat sheet: treat its contents with caution!


APT tools

APT, is a package management system used on most Debian based distros.

It should not be mistaken with apt, an APT tool which provides a high-level command line interface for the package management system. It is intended as an end user interface and enables some options better suited for interactive usage by default compared to more specialized tools like apt-get and apt-cache (which are both considered as lower-level and more backwards compatible, so better suited for scripting).

Do not mistake apt with Aptitude, which not only has a command line interface but also a ncurses interface. Aptitude is considered a higher-level package manager that abstract more low-level details.

Reference(s)

Table of content


apt

  • Check whether packagename is installed:

    $ apt -qq list packagename
    

  • Full system update/upgrade:

    # apt update
    # apt list --upgradable
    # apt full-upgrade
    # apt --purge autoremove # removes deps and systemwide configuration files too
    

  • Remove a package

    # apt purge package-to-remove
    # apt --purge autoremove # removes deps and systemwide configuration files too
    

  • List all installed packages:

    $ apt list --installed
    

  • List manually installed packages (not their dependencies):

    $ grep " install " $HOME/.bash_history
    

Search package files

Install apt-file utility:

# apt install apt-file

Update it:

# apt-file update

Search for a file

$ apt-file search fontconfig.pc

Install deb package

Reference(s)
# apt install path_to_deb_file

If you get dependencies errors when installing the deb package, you might want to force the installation anyway:

# apt install -f

Uninstall package

$ apt remove program_name

apt-get

TODO


apt-cache

TODO


Aptitude

TODO


If this cheat sheet has been useful to you, then please consider leaving a star here.