The Ultimate Debian Apt-Get Command Cheat Sheet

Advanced Package Tool (apt-get) serves as the command -line tool for handling packages for Debian Linux with the intention to:

  • Upgrade packages
  • Keep Debian system up to date
  • Download source .deb files
  • Install/manage individual packages
  • Apply security patch(es)

It also has many GUI and other utilities as front-ends.

If you are not the root user, you will have to add sudo before any of the commands listed.

The following commands will need to be run from terminal, which you open by typing:

Ctrl+Alt+T

Install New Package.

If the package you seek has been installed then you can upgrade to the latest version:

apt-get install {package}

Delete Package

apt-get remove {package}

This, however, does not include deletion of associated configuration files. To do this, you are going to have to run:

apt-get --purge remove {package}

Upgrade The Linux System

This allows you to resynchronize the package index files as well the very important security update. You are going to need to be connected to the internet for this to be done right.

apt-get update

apt-get upgrade

Upgrade To a Debian Distribution

If you are running Woody and would like to switch to Sarge for instance.In addition to the upgrade, however, dist-upgrade also handles changing dependencies with new versions of packages.

apt-get has an automatic conflict resolution system, and it will attempt to upgrade the most important packages at the expense of less important ones should the need arise. Again, the internet will be required for this upgrade.

apt-get update

apt-get dist-upgrade

RELATED: The Ultimate Apt-Get Package Management Cheat Sheet for Debian Linux or Ubuntu