Categories: Ubuntu

How to Install aptitude on Ubuntu 22.04

In this article, we will see how to install aptitude on Ubuntu 22.04. aptitude is a free and open source text-based package manager for Debian and Debian-based Linux distributions, including Ubuntu. It is a front-end to the Advanced Packaging Tool (APT) system, which is used to manage packages on these systems. aptitude offers a user-friendly interface for package management and combines the functionality of several other APT-based tools. It is quite easy to install and use. Here we will see the steps to install aptitude on Ubuntu 22.04 based servers.

 

Key Features

  • User Interface: Aptitude can be used in both a text-based user interface (TUI) and in a command-line mode. The TUI is interactive and navigable, making it user-friendly for those who prefer a menu-driven interface over traditional command-line operations.
  • Sponsored
  • Package Management: It allows users to install, upgrade, and remove software packages. This includes handling dependencies to ensure that all necessary additional packages are installed and that conflicts are managed.
  • Advanced Search Capabilities: Aptitude provides advanced search functions for finding packages. It allows users to search for packages using complex criteria, not just by package names.
  • Conflict Resolution: One of the standout features of Aptitude is its conflict resolution system. It suggests various ways to resolve package conflicts that might occur during installation or upgrading.
  • Tracking of Automatically Installed Packages: Aptitude keeps track of which packages were automatically installed to satisfy dependencies, and it can remove them automatically when they are no longer needed.
  • Log of Actions: It maintains a log of actions taken, such as packages installed, upgraded, or removed, which can be useful for system administration and troubleshooting.
  • Full APT Compatibility: Aptitude is fully compatible with APT, meaning it uses the same package repository and package format. It is often recommended as a more advanced alternative to the apt-get and apt-cache commands.

 

How to Install aptitude on Ubuntu 22.04

Also Read: How to Install .NET 8 SDK on Ubuntu 20.04

Step 1: Prerequisites

a) You should have a running Ubuntu 22.04 Server.

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

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

d) You should also have dpkg utility available in your Server.

 

Step 2: Update Your Server

To safeguard your system from security vulnerabilities, install all the latest available security patches and updates using sudo apt update && sudo apt upgrade command as shown below. This will keep your system stable and secure.

cyberithub@ubuntu:~$ sudo apt update && sudo apt upgrade
Hit:1 https://artifacts.elastic.co/packages/8.x/apt stable InRelease
Hit:2 http://security.ubuntu.com/ubuntu jammy-security InRelease
Hit:3 https://dl.google.com/linux/chrome/deb stable InRelease
Hit:4 http://in.archive.ubuntu.com/ubuntu jammy InRelease
Hit:5 http://in.archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:6 https://ppa.launchpadcontent.net/libreoffice/ppa/ubuntu jammy InRelease
Hit:7 https://ppa.launchpadcontent.net/unit193/encryption/ubuntu jammy InRelease
Hit:8 http://in.archive.ubuntu.com/ubuntu jammy-backports InRelease
Hit:9 https://ngrok-agent.s3.amazonaws.com buster InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

 

 

Step 3: Install aptitude

In the next step, you can install aptitude from default Ubuntu repo by using sudo apt install aptitude command as shown below. This will download and install the package along with all its dependencies.

Sponsored
cyberithub@ubuntu:~$ sudo apt install aptitude
[sudo] password for cyberithub:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
libutempter0 xbitmaps
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
aptitude-common libcwidget4 libxapian30
Suggested packages:
apt-xapian-index aptitude-doc-en | aptitude-doc debtags tasksel libcwidget-dev xapian-tools
The following NEW packages will be installed:
aptitude aptitude-common libcwidget4 libxapian30
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 3,826 kB of archives.
After this operation, 17.3 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://in.archive.ubuntu.com/ubuntu jammy/universe amd64 aptitude-common all 0.8.13-3ubuntu1 [1,719 kB]
Get:2 http://in.archive.ubuntu.com/ubuntu jammy/universe amd64 libcwidget4 amd64 0.5.18-5build1 [306 kB]
Get:3 http://in.archive.ubuntu.com/ubuntu jammy/universe amd64 libxapian30 amd64 1.4.18-4 [701 kB]
Get:4 http://in.archive.ubuntu.com/ubuntu jammy/universe amd64 aptitude amd64 0.8.13-3ubuntu1 [1,100 kB]
Fetched 3,826 kB in 2s (1,943 kB/s)
..........................................................

 

 

Step 4: Verify Installation

After successful installation, you can verify installation status by running dpkg -s aptitude command as shown below.

cyberithub@ubuntu:~$ dpkg -s aptitude
Package: aptitude
Status: install ok installed
Priority: optional
Section: admin
Installed-Size: 3539
Maintainer: Ubuntu Developers 
Architecture: amd64
Multi-Arch: foreign
Version: 0.8.13-3ubuntu1
Depends: aptitude-common (= 0.8.13-3ubuntu1), libapt-pkg6.0 (>= 1.9.11~), libboost-iostreams1.74.0 (>= 1.74.0), libc6 (>= 2.33), libcwidget4 (>= 0.5.18-1), libgcc-s1 (>= 3.3.1), libncursesw6 (>= 6.1+20180210), libsigc++-2.0-0v5 (>= 2.8.0), libsqlite3-0 (>= 3.6.5), libstdc++6 (>= 9), libtinfo6 (>= 6.1+20180210), libxapian30 (>= 1.4.17~)
Recommends: libdpkg-perl, sensible-utils
Suggests: apt-xapian-index, aptitude-doc-en | aptitude-doc, debtags, tasksel
Conffiles:
 /etc/cron.daily/aptitude f934222d5eb13cb132e2751bdb023318
 /etc/logrotate.d/aptitude fb66bc5dc8c13edbcb83cea15ff86959
....................................................

 

 

Step 5: Check version

You can check the current installed version by using aptitude --version command as shown below.

cyberithub@ubuntu:~$ aptitude --version
aptitude 0.8.13
Compiler: g++ 10.2.1 20210320
Compiled against:
apt version 6.0.0
NCurses version 6.2
libsigc++ version: 2.10.4
Gtk+ support disabled.
Qt support disabled.

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

 

Step 6: Install a package

Now that aptitude utility is installed, let’s use it to install a package in the system by using sudo aptitude install command. For example, here we are installing a package called xterm using sudo aptitude install xterm command as shown below.

cyberithub@ubuntu:~$ sudo aptitude install xterm
[sudo] password for cyberithub:
The following NEW packages will be installed:
xterm
0 packages upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 857 kB of archives. After unpacking 2,448 kB will be used.
Get: 1 http://in.archive.ubuntu.com/ubuntu jammy/universe amd64 xterm amd64 372-1ubuntu1 [857 kB]
Fetched 857 kB in 1s (609 kB/s)
(Reading database ... 238199 files and directories currently installed.)
Preparing to unpack .../xterm_372-1ubuntu1_amd64.deb ...
Unpacking xterm (372-1ubuntu1) ...
Setting up xterm (372-1ubuntu1) ...
Processing triggers for desktop-file-utils (0.26-1ubuntu3) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu3) ...
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for mailcap (3.70+nmu1ubuntu1) ...

 

 

Step 7: Remove a Package

You can also remove a package using sudo aptitude remove command. For example, here we are removing xterm package from system by running sudo aptitude remove xterm command as shown below.

cyberithub@ubuntu:~$ sudo aptitude remove xterm
The following packages will be REMOVED:
libutempter0{u} xbitmaps{u} xterm
0 packages upgraded, 0 newly installed, 3 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 2,748 kB will be freed.
Do you want to continue? [Y/n/?] Y
(Reading database ... 238239 files and directories currently installed.)
Removing xterm (372-1ubuntu1) ...
Removing libutempter0:amd64 (1.2.1-2build2) ...
Removing xbitmaps (1.1.1-2.1ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu3) ...
Processing triggers for libc-bin (2.35-0ubuntu3.5) ...
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for mailcap (3.70+nmu1ubuntu1) ...
Processing triggers for desktop-file-utils (0.26-1ubuntu3) ...

 

Step 8: Check all available options

You can check all the options available to use with aptitude utility using aptitude --help command as shown below.

cyberithub@ubuntu:~$ aptitude --help
aptitude 0.8.13
Usage: aptitude [-S fname] [-u|-i]
       aptitude [options]  ...

Actions (if none is specified, aptitude will enter interactive mode):

 install         Install/upgrade packages.
 remove          Remove packages.
 purge           Remove packages and their configuration files.
 hold            Place packages on hold.
 unhold          Cancel a hold command for a package.
 markauto        Mark packages as having been automatically installed.
 unmarkauto      Mark packages as having been manually installed.
 forbid-version  Forbid aptitude from upgrading to a specific package version.
 update          Download lists of new/upgradable packages.
 safe-upgrade    Perform a safe upgrade.
.........................................................

 

Step 9: Uninstall aptitude

Once you are done using aptitude package manager, you can also choose to remove it from your system by using sudo apt remove aptitude command as shown below. If you are looking to remove all dependencies along with the package then use --auto-remove option with below command.

cyberithub@ubuntu:~$ sudo apt remove aptitude
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 libxapian30
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
aptitude
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 3,624 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 238114 files and directories currently installed.)
Removing aptitude (0.8.13-3ubuntu1) ...
Ubuntu Server Admin

Recent Posts

Building RAG with enterprise open source AI infrastructure

One of the most critical gaps in traditional Large Language Models (LLMs) is that they…

16 hours ago

Life at Canonical: Victoria Antipova’s perspective as a new joiner in Product Marketing

Canonical is continuously hiring new talent. Being a remote- first company, Canonical’s new joiners receive…

2 days ago

What is patching automation?

What is patching automation? With increasing numbers of vulnerabilities, there is a growing risk of…

3 days ago

A beginner’s tutorial for your first Machine Learning project using Charmed Kubeflow

Wouldn’t it be wonderful to wake up one day with a desire to explore AI…

4 days ago

Ubuntu brings comprehensive support to Azure Cobalt 100 VMs

Ubuntu and Ubuntu Pro supports Microsoft’s Azure Cobalt 100 Virtual Machines (VMs), powered by their…

4 days ago

Ubuntu Weekly Newsletter Issue 870

Welcome to the Ubuntu Weekly Newsletter, Issue 870 for the week of December 8 –…

4 days ago