Aptitude - Debian GNU/Linux Package Management Tool | Linoxide

Channel: Linux
Abstract: the command to install mysql-server package using apt-get will be like this sudo apt-get install mysql-server. Apt is run as a command line form. For

For you who use Debian Linux or Ubuntu and its derivative such as Linux Mint, will surely know about Advanced Packaging Tool (APT) system. As you can guess from its name, apt is used as package management tool. The most popular command may be apt-get command. Generally, or at least apt-get is used to install or remove packages.

For example, the command to install mysql-server package using apt-get will be like this sudo apt-get install mysql-server.

Apt is run as a command line form. For those who prefer an interface to apt system can use aptitude. Aptitude is run in console mode or terminal. For Graphical User Interface (GUI) version, there is a similar tool named Synaptic. We will show you about Aptitude.

Install Git on Ubuntu

To view this video please enable JavaScript, and consider upgrading to a web browser that supports HTML5 video

Install Git on Ubuntu Installation

Generally, aptitude is installed by default. If it is not, you can install it using apt-get command.

First, update the index packages files

sudo apt-get update

Then install aptitude

sudo apt-get install aptitude
Using Aptitude

You can run aptitude both in CLI mode or Interface mode. Running it without parameter will show you in Interface mode. Aptitude needs root privileges, so you can run aptitude by typing sudo aptitude in your console.

To access the Menu, you can press Ctrl-T. Then you can move between menus using arrow button on your keyboard.

Installing packages

To install packages, you can browse the packages first. After you found the package(s) , select it then press + (plus sign) button. Press g button to preview the summary of package actions. To commit the installation press g button again.

You may see the state of the packages on the left the name of packages. Here’s a list of the packages state :

i : Installed package
c: Package not installed, but the configuration remains on the system
p : Purged from system
v : Virtual package
B : Broken package
u : Unpacked files, but files not yet configured
C : Half-configured - Configuration failed and require fix
H : Half-installed - Removal failed and require fix

In CLI mode you can use the install parameter to install new package. Let say we want to install GIMP, then the command will be like :

sudo aptitude install gimp

Removing package

To remove a package simply select a package then press - (minus sign) button. Press g button to view a summary of the activity. Press g button again to commit remove the package.

In CLI mode, you can use remove parameter to remove package. Let say we want to remove gedit application, then the command will be like :

sudo aptitude remove gedit

Update the package Index

To update the package index, simply press u botton.

Or type sudo aptitude update from console

Upgrading package

To upgrade packages, press U button. It will mark all upgradable packages. Then press g button to view the summary of packages actions. Press g button again to commit the upgrade process.

In CLI mode there are 2 different way to upgrade package. Here there are :

Safe-upgrade

Safe upgrade means aptitude will upgrade installed packages into the most recent version. The installed packages will not be removed until they are not used anymore. If you run safe-upgrade with no package name supplied then aptitude will upgrade every package that can be upgraded.

You can do it using

sudo aptitude safe-upgrade

Full-upgrade

Full-upgrade is similar with safe-upgrade. The difference is full-upgrade is less conservative that safe-upgrade. It may lead you to have unwanted actions. However, full-upgrade can perform upgrade which safe-upgrade can not. In the apt-get tool, this is known as dist-upgrade parameter.

Here's the syntax

sudo aptitude full-upgrade
Why use Aptitude

Apt and Aptitude relies on the same system called dpkg. It’s similar with RPM on RedHat based Linux. But there are a few differences between Apt and Aptitude. Here are some the differences :

  • Aptitude performs the functionalities of apt-cache and apt mark. Not just apt-get
  • Aptitude will remove all unused dependencies wherever you remove a package.
  • Aptitude has a resolver function. This will give you suggestions when the process of installing, removing or upgrading cause conflict.
  • Aptitude keeps track of obsolete software and listing it under 「Obsolete and Locally Created Packages」
  • Aptitude has a download parameter which downloads a package into .deb file

Of course, there is still a lot of features that have not discussed here. You are always can type man aptitude or visit Aptitude User Manual to explore more detail.

Ref From: linoxide
Channels:

Related articles