How to install packages on Debian from the terminal

NicolasBrondinBernard

Author
@NicolasBrondinBernard

Want to install and uninstall your software directly from the command console? Here's how to do it on Debian, Ubuntu, Kali Linux, and more.

Article published on 25/04/2022, last updated on 10/08/2026

Installing software on Debian, or on Debian-based distributions (Ubuntu, Pop_Os, Kali,...) is very simple thanks to the APT package manager.

APT stands for Advanced Packaging Tool

"Packages" are simply software referenced by specific versions and which list their dependencies in order to automatically install all the tools necessary for the software to work properly.

Note that depending on the user rights you have, you may need to prefix some of these commands with "sudo".

#1 - Update the package list

APT works from a list of sources, each source containing a list of packages. For APT to know the available packages.

To make sure the available packages are up to date, you need to use the following command:

$> apt update

#2 - Search for a package

Before installing a package, you need to know its exact name, and this is not always obvious because there are often variations.

For example, to create a database, the package will not be called "mysql" but "mysql-server".

You can either search for packages whose name contains the one you're looking for:

$> apt list <name> 

Or, if the search is unsuccessful, you can also search in the package description:

$> apt search <word> 

#3 - Install a package

Once the package is found, you can install it simply with the "apt install" command, as shown below:

$> apt install <package> 

#4 - Update one/several package(s)

You have the choice between updating ALL packages (system ones and those installed afterwards):

$> apt upgrade

Or by installing the latest available updates for a particular package:

$> apt install <package> --only-upgrade

#5 - Remove a package

Here is the command to uninstall software directly from the terminal (only works with packages installed with APT).

$> apt remove <package>

Note that if the package uses dependencies, these dependencies will not be removed.

To go further

If you want to discover the other commands available with APT to learn how to master package management on Debian, Ubuntu, etc... I recommend going directly to read the tool's documentation:

https://doc.ubuntu-fr.org/apt


Arif Riyanto sur Unsplash

Finished reading this article?
Our complete courses
Take it to the next level with our courses!

Complete courses, exercises and certificates to really learn programming!

4.8 average rating

Comments (0)

to leave a comment

No comments yet