Linux Package Management with Aptitude


Aptitude is founded by Ncurses for APT front End and debian Bundle Manager, considering the fact that it is text-based and it runs from a terminal or a CLI – command line interface. This article explains about-“Linux Package Management with Aptitude”

What is APT

apt is a command line package manager and provides commands for searching and managing as well as querying information about packages. It provides the same functionality as the specialized APT tools, like apt-get and apt-cache, but enables options more suitable for interactive use by default.]

To get more information about APT, use the following command –

$ apt

The sample output should be like this –

apt 1.2.15 (amd64)
Usage: apt [options] command
apt is a commandline package manager and provides commands for
searching and managing as well as querying information about packages.
It provides the same functionality as the specialized APT tools,
like apt-get and apt-cache, but enables options which are more suitable for
interactive use by default.
Most used commands:
   list - list packages based on package names
   search - search in package descriptions
   show - show package details
   install - install packages
   remove - remove packages
   autoremove - Remove automatically all unused packages
   update - update list of available packages
   upgrade - upgrade the system by installing/upgrading packages
   full-upgrade - upgrade the system by removing/installing/upgrading packages
   edit-sources - edit the source information file
See apt(8) for more information about the available commands.
Configuration options and syntax is detailed in apt.conf(5).
Information about how to configure sources can be found in sources.list(5).
Package and version choices can be expressed via apt_preferences(5).
Security details are available in apt-secure(8).
This APT has Super Cow Powers.

List of Packages

To get a list of packages based on package name, use the following command –

$ apt list

The sample output should be like this –

revolution-r/xenial,xenial 3.0.0-1ubuntu1 all
revu-tools/xenial,xenial,trusty,trusty 0.6.1.5 all
rex/xenial,xenial 1.3.3-1 all
rexical/xenial,xenial 1.0.5-2build1 all
rexima/xenial 1.4-7build1 amd64
rfc5766-turn-server/trusty 3.2.3.1-1 amd64
rfcdiff/xenial,xenial 1.42-1 all
rfdump/xenial 1.6-4 amd64
rfkill/xenial,now 0.5-1ubuntu3 amd64 [installed,automatic]
rgbpaint/xenial,trusty 0.8.7-5 amd64
rgxg/xenial,trusty 0.1-1 amd64
rhash/xenial 1.3.3-1 amd64
rhc/xenial,xenial 1.38.4-2 all
rheolef/xenial 6.6-1build2 amd64
rheolef-doc/xenial,xenial 6.6-1build2 all
rhino/xenial,xenial 1.7R4-3 all
rhino-doc/xenial,xenial 1.7R4-3 all
rhinote/xenial,xenial,trusty,trusty 0.7.4-2 all
rhn-client-tools/xenial 1.8.26-4 amd64
rhnsd/xenial 5.0.4-3 amd64
..................................................................

Installing a package

To install a package with APT, use the following command –

$ sudo apt install firefox

The above command installs firefox. The sample output should be like this –

Reading package lists... Done
Building dependency tree
Reading state information... Done
firefox is already the newest version (50.1.0+build2-0ubuntu0.16.04.1).
firefox set to manually installed.
The following packages were automatically installed and are no longer required:
   libterm-readkey-perl linux-headers-4.4.0-31 linux-headers-4.4.0-31-generic
   linux-image-4.4.0-31-generic linux-image-extra-4.4.0-31-generic
   linux-signed-image-4.4.0-31-generic
Use 'sudo apt autoremove' to remove them.
..................................................................

Removing a package

To remove a package using APT, use the following command –

$ sudo apt remove firefox

The above command removing firefox package from Linux. The sample output should be like this –

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libterm-readkey-perl linux-headers-4.4.0-31 linux-headers-4.4.0-31-generic
linux-image-4.4.0-31-generic linux-image-extra-4.4.0-31-generic
linux-signed-image-4.4.0-31-generic
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
firefox
0 upgraded, 0 newly installed, 1 to remove and 26 not upgraded.
After this operation, 114 MB disk space will be freed.

Removing unused packages

To automatically remove all the unused packages, use the following command –

$ sudo apt autoremove

The sample output should be like this –

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
libterm-readkey-perl linux-headers-4.4.0-31 linux-headers-4.4.0-31-generic
linux-image-4.4.0-31-generic linux-image-extra-4.4.0-31-generic
linux-signed-image-4.4.0-31-generic
0 upgraded, 0 newly installed, 6 to remove and 26 not upgraded.
After this operation, 295 MB disk space will be freed.
..............................................................................

Updating the packages

To update the packages, use the following command –

$ sudo apt update

Upgrading the packages

To upgrade the system by installing/upgrading packages, use the following command –

$ sudo apt upgrade

After this article, you will be able to understand “Linux Package Management with Aptitude”, we will come up with more Linux based tricks and tips. Keep reading!

Sharon Christine
Sharon Christine

An investment in knowledge pays the best interest

Updated on: 17-Jan-2020

222 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements