Utilisation d’aptitude

Sur les distributions utilisant apt ( paquets .deb ), il est aussi possible d’utiliser la surcouche aptitude. C’est une façon simple et pratique de gérer l’installation/désinstallation et mise à jour des logiciels.

Voici quelques exemples d’utilisation.

Mettre à jour la liste des paquets ( logiciels disponibles )

root@server:~# aptitude update
Hit http://debian.mirrors.ovh.net squeeze Release.gpg
Ign http://debian.mirrors.ovh.net/debian/ squeeze/main Translation-en
Ign http://debian.mirrors.ovh.net/debian/ squeeze/main Translation-en_GB
Hit http://debian.mirrors.ovh.net squeeze Release
Hit http://debian.mirrors.ovh.net squeeze/main Sources      
Hit http://debian.mirrors.ovh.net squeeze/main amd64 Packages
Get:1 http://security.debian.org squeeze/updates Release.gpg [836 B]
Ign http://security.debian.org/ squeeze/updates/main Translation-en
Ign http://security.debian.org/ squeeze/updates/main Translation-en_GB
Get:2 http://security.debian.org squeeze/updates Release [86.9 kB]
Get:3 http://security.debian.org squeeze/updates/main Sources [90.3 kB]
Get:4 http://security.debian.org squeeze/updates/main amd64 Packages [270 kB]
Fetched 448 kB in 0s (691 kB/s)

Installer les dernières versions disponibles des paquets installés

root@server:~# aptitude upgrade
The following packages will be upgraded:
....
13 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 2,378 kB of archives. After unpacking 0 B will be used.
Do you want to continue? [Y/n/?] Y
Get:1 http://security.debian.org/ squeeze/updates/main lwresd amd64 1:9.7.3.dfsg-1~squeeze8 [244 kB]
Get:2 http://security.debian.org/ squeeze/updates/main bind9 amd64 1:9.7.3.dfsg-1~squeeze8 [355 kB]
....
Fetched 2,378 kB in 0s (2,454 kB/s)
Reading changelogs... Done
Preconfiguring packages ...
(Reading database ... 22898 files and directories currently installed.)
Preparing to replace lwresd 1:9.7.3.dfsg-1~squeeze7 (using .../lwresd_1%3a9.7.3.dfsg-1~squeeze8_amd64.deb) ...
Unpacking replacement lwresd ...
....
Current status: 0 updates [-13].

Recherche d’un paquet

root@ks3267918:~# aptitude search apache
p   apache2                                                     - Apache HTTP Server metapackage
p   apache2-dbg                                                 - Apache debugging symbols
v   apache2-dev                                                 -
p   apache2-doc                                                 - Apache HTTP Server documentation       

Installation d’un paquet

root@ks3267918:~# aptitude install htop
The following NEW packages will be installed:
  htop
0 packages upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 63.7 kB of archives. After unpacking 209 kB will be used.
Get:1 http://debian.mirrors.ovh.net/debian/ squeeze/main htop amd64 0.8.3-1 [63.7 kB]
Fetched 63.7 kB in 0s (105 kB/s)
Selecting previously deselected package htop.
(Reading database ... 22898 files and directories currently installed.)
Unpacking htop (from .../htop_0.8.3-1_amd64.deb) ...
Processing triggers for man-db ...
Setting up htop (0.8.3-1) ...