Cyberithub

How to Install aptitude package on Ubuntu/Debian with Example

Advertisements

In this article, I will go through the Steps to install aptitude command on Ubuntu/Debian based systems with example. If you are a Linux professional, then you might be aware of package manager which is required to perform operations like install, update and removal of packages. If you are using RHEL/Fedora/CentOS based systems then you might be using yum or dnf package manager. If you are using OpenSUSE or SUSE based systems then you might be using zypper package manager. If you are using Ubuntu/Debian based Systems, then you might be using apt or apt-get package manager.

Similarly, there is one more package manager called aptitude for Ubuntu/Debian based Systems which can be used to install, remove and update packages just like any other package manager. aptitude actually calls the apt command to perform underlying package operations. We will see the steps to install aptitude package manager in below section. More about aptitude usage.

How to Install aptitude package on Ubuntu/Debian with Example

How to Install aptitude package on Ubuntu/Debian

Also Read: 21+ aptitude command examples for Package Management in Linux

Step 1: Prerequisites

a) You should have a running Ubuntu/Debian Server.

b) You should have sudo or root access to run privileged command.

c) You should have apt or apt-get utility installed in your Server.

 

Step 2: Update Your Server

Before installing a new package, it is always recommended to first update your System using apt update or apt-get update command. This will sync the installed packages version with the latest stable version available on the configured Debian Repo.

root@debian:~# apt update
Hit:1 http://deb.debian.org/debian bullseye InRelease
Get:2 http://deb.debian.org/debian bullseye-updates InRelease [39.4 kB]
Get:3 http://security.debian.org/debian-security bullseye-security InRelease [44.1 kB]
Get:4 http://security.debian.org/debian-security bullseye-security/main Sources [38.6 kB]
Get:5 http://security.debian.org/debian-security bullseye-security/main amd64 Packages [47.4 kB]
Get:6 http://security.debian.org/debian-security bullseye-security/main Translation-en [31.7 kB]
Fetched 201 kB in 1s (136 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done

 

Step 3: Install aptitude package

Next step is to install aptitude package using apt install aptitude -y or apt-get install aptitude -y command as shown below. This will automatically download and install aptitude package along with its dependencies from Debian Repo.

root@debian:~# apt install aptitude -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
default-jdk-headless libice-dev libpthread-stubs0-dev libsm-dev libx11-dev libxau-dev libxcb1-dev libxdmcp-dev libxt-dev openjdk-11-jdk
openjdk-11-jdk-headless x11proto-dev xorg-sgml-doctools xtrans-dev
Use 'apt autoremove' to remove them.
The following additional packages will be installed:
aptitude-common libcwidget4
Suggested packages:
apt-xapian-index aptitude-doc-en | aptitude-doc debtags libcwidget-dev
The following NEW packages will be installed:
aptitude aptitude-common libcwidget4
0 upgraded, 3 newly installed, 0 to remove and 3 not upgraded.
Need to get 3,441 kB of archives.
After this operation, 15.9 MB of additional disk space will be used.

 

Step 4: Check aptitude version

After successful installation, you can check the current installed version of aptitude package by using aptitude --version command as shown below. As you can see current version is 0.8.12.

root@debian:~# aptitude --version
aptitude 0.8.12
Compiler: g++ 9.2.1 20200224
Compiled against:
apt version 6.0.0
NCurses version 6.2
libsigc++ version: 2.10.2
Gtk+ support disabled.
Qt support disabled.

Current library versions:
NCurses version: ncurses 6.2.20200212
cwidget version: 0.5.18
Apt version: 6.0.0

 

Step 5: Using aptitude command

It is now time to test aptitude package manager by installing a sample package. For the sake of example we are installing wget package using aptitude install wget -y command as shown below. As you can see the steps to install a package using aptitude command is not much different from apt or apt-get package manager.

root@debian:~# aptitude install wget -y
The following NEW packages will be installed:
wget
0 packages upgraded, 1 newly installed, 0 to remove and 3 not upgraded.
Need to get 964 kB of archives. After unpacking 3,560 kB will be used.
Get: 1 http://deb.debian.org/debian bullseye/main amd64 wget amd64 1.21-1+b1 [964 kB]
Fetched 964 kB in 1s (1,673 kB/s)
(Reading database ... 135755 files and directories currently installed.)
Preparing to unpack .../wget_1.21-1+b1_amd64.deb ...
Unpacking wget (1.21-1+b1) ...
Setting up wget (1.21-1+b1) ...
Processing triggers for man-db (2.9.4-2) ...

 

Step 6: Remove aptitude package

Once you are done with the package, you can also remove it by using apt remove aptitude -y command as shown below.

root@debian:~# apt remove aptitude -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
aptitude-common libcwidget4
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
aptitude
0 upgraded, 0 newly installed, 1 to remove and 1 not upgraded.
After this operation, 4,358 kB disk space will be freed.
(Reading database ... 141498 files and directories currently installed.)
Removing aptitude (0.8.13-3) ...

Leave a Comment