GNU/Linux Package Managers How to update packages with the apt package manager


The Advanced Package Tool, aptly named the 'apt' package manager can handle the installation and removal of software on the Debian, Slackware, and other Linux Distributions. Below are some simple examples of use:

This option retrieves and scans the Packages.gz files, so that information about new and updated packages is available. To do so, enter the following command:

sudo apt-get update

This option is used to install the newest versions of all packages currently installed on the system. Packages currently installed with new versions available are retrieved and upgraded; under no circumstances are currently installed packages removed, or packages not already installed retrieved and installed. To upgrade, enter the following command:

sudo apt-get upgrade

In addition to performing the function of upgrade, dist-upgrade also intelligently handles changing dependencies with new versions of packages. It will attempt to upgrade the most important packages at the expense of less important ones if necessary. To do so, enter the following command:

sudo apt-get dist-upgrade