Ubuntu

How to Install Software Packages With APT in Linux/Ubuntu?

How to Install Software Packages with APT

A software can be installed in Linux in many ways. To run centralized applications, we can build our own executables. Apart from our own executables, we can use AppImage as well to install and run centralized applications. All Linux Distributions consist of a Package Management System. Most of the Linux distros use the “Apt” package management library that handles the management of applications including the installation and removal.

This article discusses how we can install software packages using apt.

How to Install Software Packages With APT in Linux/Ubuntu?

APT or Advanced Package Tool handles the installation and removal of packages and software in Ubuntu. It works by downloading packages from repositories. We can use APT in many ways for different purposes. Most of the APT commands can be run with sudo privileges. The most common commands with APT are:

  1. apt install
  2. apt update
  3. apt upgrade
  4. apt remove
  5. apt list

How to Install Software Using apt?

The “apt install” installs a package from a specified repository and you can install the package using the syntax:

sudo apt install <package-name>

If we want to install “VLC”, we can use the apt install command as follows:

sudo apt install vlc

It will take some time and once it is installed we can access the application:

How to Update Software Using apt?

The APT Update command is used to update/refresh packages in the repository. It updates the package index file. Thus before installing any new package, it is highly recommended to update the system repository by the command:

sudo apt update

How to Upgrade Software Using apt?

Now once the packages in the repository are updated, we need to install them as well. APT Upgrade upgrades the actual packages installed in our system. To upgrade the updated packages in the system, use the following command:

sudo apt upgrade

How to Remove Software Using apt?

The APT Remove is used to uninstall the given package. To uninstall an installed package we use the following command:

sudo apt remove <package-name>

The remove command uninstalls the package but it might leave some configuration files in our system. To remove the package with all of its configuration as well, use the purge command instead of remove:

sudo apt purge <package-name>

In the example below we purge “vlc” from our system:

sudo apt purge vlc

How to List Software Using apt?

APT List lists all the packages. The “list” command can be executed as:

sudo apt list

We can also filter our list. To retrieve only the list of packages that are upgradeable, we can use the command:

sudo apt list -upgradeable

This will only list the packages that can be upgraded:

That’s all about installing, updating, upgrading, listing, and removing a software package using APT in Linux/Ubuntu.

Conclusion

To install packages with APT in Linux/Ubuntu, the “sudo apt install <package-name>” command is used. “apt” is the package management tool in Linux distributions, like Ubuntu 22.04. It allows you to install, update, upgrade, remove, list, and manage packages. In this article, we covered the different methods of the APT Package Management Library covering the installation procedure, the updating procedure, the upgradation procedure, and the process of removal and listing of packages.

Similar Posts