What Is aptitude And How To Use It?
 

What Is aptitude And How To Use It?

 

This post was last updated on August 1st, 2020 at 10:51 pm

I already briefly discussed aptitude which is a debian package manager. In this article, we will see it in more detail, and also we will discuss how can we use it in different modes, i.e. interactive and command-line mode.

Aptitude is a high-level interface to the package manager that is used in Debian based Linux distributions. It provides a text-based menu that displays a list of packages and allows a user to perform package management tasks such as installation, removal, and up-gradation of packages. Actions are performed from a visual terminal-based menu by using a single key command.

Some useful features of aptitude

  • Apart from the terminal-based menu, it can be also used in command-line mode. For example, to install a package you can use –
    $ sudo aptitude install package_name
  • You can preview an action that is about to be taken different color marking is used for different actions
  • It has the ability to interactively retrieve and display the changelog of all available official packages
  • You can mark a package as automatically or manually installed so that packages can be auto removed if no longer required
  • It has score based dependency resolver which is more suitable for interactive dependency resolution

What is Aptitude interactive mode?

In this mode, a list of upgradable, installed, or not installed packages is displayed as the menu in the terminal. To use aptitude in interactive mode, use the following command in your terminal –

$ aptitude

Now the terminal menu will look something like this –

After running it you can use the following keys –

  • Ctrl+t to access the menu
  • Use ? for help
  • q to quit or close the current opening window
  • Up, down, right and left keys to navigate
  • Use key to preview, install or remove a package
  • The Enter key used to select or open or close a single level in the current window
  • Use / and \ for forward and backward searching of a package
  • To open and close level recursively [ or ] keys are used

If you do not run aptitude command with superuser privileges then before performing an action like installation or removal of a package it may prompt you to switch to the root user. You should confirm it if you want to perform such actions.

What is Aptitude command-line mode?

You can use aptitude also in command-line mode just like we use apt or apt-get. The following are some aptitude commands that you can use. You should either use these commands with superuser privileges or switch to root user and then execute them-

To install a package –

aptitude install package-name

To uninstall or remove a package –

aptitude remove package-name

Use the following command to remove a package along with its dependensies-

aptitude purge package-name

To update the package list or apt’s database-

aptitude update

To upgrade the packages safely use the following command –

aptitude safe-upgrade

Use the following command to search a package in Linux. It will list all the packages that match with the pattern –

aptitude search package-name

To display the details of an installed package in your system use the following command-

aptitude show package-name

Look at the screenshot below it shows the use of aptitude in command-line mode-

aptitude vs apt-get

Aptitude and apt-get both are high-level interfaces to package manager in Debian and its derivatives. The most obvious difference between these two is that aptitude provides a terminal menu interface while apt-get does not. If you only consider the command-line interface of each then both are quite similar to each other. Some minor difference are given below-

  • Few commands are different like upgrade and dist-upgrade are renamed in the aptitude to probably more accurate names that are safe-upgrade and full-upgrade respectively
  • aptitude performs functions of not only apt-get but some other similar tools like apt-cache, apt-mark, etc
  • aptitude has slightly different query syntax for searching for a package from apt-cache. The aptitude search result may contain a little bit more information.
  • aptitude can suggest several potential resolutions while performing an action like installation, removal or up-gradation of a package But this feature is not available in apt-get

 

Previous How to Find Exact Name of A Package by Using apt-cache in Linux?
Next How to Configure Sudo to run Without Password or Password-less
 

About author

You might also like

Linux Topics 0 Comments

How to install FileZilla in Ubuntu 20.04 LTS ?

Filezilla is a free, opensource, and cross-platform FTP application. This application is based on the client-server model. You can visit Filezilla’s website to download the client and server binaries. The

How To 0 Comments

How To Remove/Uninstall Software Packages From Debian, Ubuntu, Linux Mint?

This post was last updated on August 1st, 2020 at 12:21 pmDifferent Linux distribution comes with different tools to manage software packages on it. Debian and its derivative use the

Linux Topics 0 Comments

Virtualization In Linux With Xen

This post was last updated on August 3rd, 2020 at 02:20 pmContents1 Virtualization Technology2 Hardware Virtualization2.1 1. Full virtualization –2.2 2. Paravirtualization–2.3 3. OS level virtualization –2.4 4. Hybrid virtualization

0 Comments

No Comments Yet!

You can be first to comment this post!

Leave a Reply