Linux 101 : Handling packages - apt, dpkg, ... -



APT Advanced Package Tool offers us a set of commands to manage applications - install, update, remove, ... - on a Debian machines.

APT keeps information about different packages stored on the local machine to save time and make the access to the database quicker.

In order to have an updated local APT database - information about packages, versions, dependencies, ... -, we use the below command to keep our database up to date:


Once our APT database is up to date, we could then upgrade system packages and the installed packages using the below command:


To be able to display information about a package in the cached database, we use the below command:  


To get information about a package before installing it, we use the above command to see if we can find it in the repositories.

To install a package on a system, we use the below command:


In order to remove a package from a system, we use the below command:


The above command doesn't delete the configuration files, in case we want to reinstall that package.
To be able to remove a package and all its configuration files, we would use the below command:


The dpkg utility is a tool for installing packages, it is way simpler than the APT tool, since it doesn't install package dependencies. 

The below command installs a package using the "dpkg" command:


The dpkg tool can work on machines that are not connected to the internet, so the Debian packages we want to install need to already be present on the machine. 

Comments

Leave as a comment:

Archive