The difference and connection between aptitude and Apt-get in Ubuntu (Debian)

Source: Internet
Author: User
Tags locale unpack

The difference and connection between aptitude and Apt-get in Ubuntu (Debian)

Like Apt-get, Aptitude is the most powerful package management tool in Debian and its derivative systems. Unlike Apt-get, aptitude is better at dealing with dependency issues. For example, when aptitude deletes a package, it also deletes the packages it depends on. This way, the system will not be left with useless packets, the whole system is cleaner. The following is a summary of some of the common aptitude commands, for reference only.
Command function
Aptitude update updates the list of available packages
Aptitude Upgrade Upgrade Available packages
Aptitude Dist-upgrade Upgrade the system to a new release
Aptitude Install Pkgname installation package
Aptitude Remove Pkgname Delete Package
Aptitude Purge Pkgname Delete package and its configuration file
Aptitude search String Searching package
Aptitude show Pkgname shows the details of the package
Aptitude Clean Delete the downloaded package file
Aptitude AutoClean Delete Expired package files only

Of course, you can also use aptitude in text interface mode.

Some problems apt-get can not solve, must use aptitude solution, some problems, with aptitude can not solve, must use Apt-get

      • Aptitude better Solution: Install, remove, reinstall (Apt-get without this function), show (Apt-get without this feature), search (Apt-get without this feature), hold (Apt-get no this feature) , Unhold (Apt-get without this function),
      • Apt-get Better solution: Source (aptitude without this function), BUILD-DEP (low version of aptitude without BUILD-DEP function)
      • Apt-get is no different from aptitude: Update, upgrade (Apt-get upgrade=aptitude Safe-upgrade, Apt-get
      • Dist-upgrade=aptitude Full-upgrgade)

Aptitude Magical Examples:

The following packages have unsatisfied dependencies:
Libreadline6-dev: dependent: libreadline6 (= 6.3-4UBUNTU2) But 6.3-8UBUNTU1 is going to be installed
E: The error cannot be corrected because you require certain packages to remain current, that is, they destroy the dependencies between the software packages.

[email protected]:~/work/gitcode/test.new.1$ Aptitude Install Libreadline6-dev Program ' Aptitude ' is not installed. You can install it using the following command: sudo apt-get install aptitude[email protected]:~/work/gitcode/test.new.1$ sudo apt-get install Aptitude is reading the package list ... Completing the dependency tree that is analyzing the package is reading state information ... Complete the following packages are installed automatically and do not need them now: Libjs-sphinxdoc libnetpbm10 libqt4-core Libqt4-gui libqt5quickparticles5 libqt5quicktest5 L IBQT5QUICKWIDGETS5 netpbm php-tcpdf thunderbird-locale-en THUNDERBIRD-LOCALE-EN-GB thunderbird-locale-en-us  THUNDERBIRD-LOCALE-ZH-CN thunderbird-locale-zh-hansuse ' Apt-get autoremove ' to remove them. The following additional packages will be installed: Aptitude-common libboost-iostreams1.54.0 Libcwidget3 libept1.4.12 recommended packages to install: Aptitude-doc-en aptitude-doc Tasksel Debtags Libcwidget-dev The following "new" packages will be installed: Aptitude Aptitude-common libboost-iostreams1.54.0 Libcwidget3 libept1.4.12 upgraded 0 Package with 5 new packages installed, 0 packages uninstalled and 107 packages not upgraded. You need to download the 2,526 KB package. 10.5 MB of extra space is consumed after decompression. Do you want to continue? [y/n] Y get: 1 http://cn.archive.ubuntu.com/ubuntu/trusty-updates/main libboost-iostreams1.54.0 i386 1.54.0-4ubuntu3.1 [29.3 KB] gets: 2 Http://cn.archive.ubuntu.com/ubuntu/trusty/main libept1.4.12 i386 1.0.12 [$ KB] gets: 3 Http://cn.archive.ubuntu.com/ubuntu/trusty/main Aptitude-common All 0.6.8.2-1UBUNTU4 [KB] gets: 4 http://cn.archive.ubuntu.com/ubuntu/trusty/main libcwidget3 i386 0.5.16-3.5UBUNTU1 [300 KB] Gets: 5 http://cn.archive.ubuntu.com/ubuntu/trusty/main aptitude i386 0.6.8.2-1ubuntu4 [1,356 kb] Download 2,526 KB, time 9 seconds (273 K b/s) Selecting p reviously unselected package libboost-iostreams1.54.0:i386. (Reading Database ... The system currently has a total of 236,171 files and directories installed. ) Preparing to unpack .../libboost-iostreams1.54.0_1.54.0-4ubuntu3.1_i386.deb ... Unpacking libboost-iostreams1.54.0:i386 (1.54.0-4ubuntu3.1) ... Selecting previously unselected package libept1.4.12:i386. Preparing to unpack .../libept1.4.12_1.0.12_i386.deb ... Unpacking libept1.4.12:i386 (1.0.12) ... Selecting previously Unselected Package Aptitude-common. Preparing to unpack .../aptitude-common_0.6.8.2-1ubuntu4_all.deb ... Unpacking Aptitude-common (0.6.8.2-1UBUNTU4) ... Selecting previously unselected package Libcwidget3. Preparing to unpack .../libcwidget3_0.5.16-3.5ubuntu1_i386.deb ... Unpacking Libcwidget3 (0.5.16-3.5UBUNTU1) ... Selecting previously unselected package aptitude. Preparing to unpack .../aptitude_0.6.8.2-1ubuntu4_i386.deb ... Unpacking aptitude (0.6.8.2-1UBUNTU4) ... Processing triggers for man-db (2.7.0.2-2) ... Setting libboost-iostreams1.54.0:i386 (1.54.0-4ubuntu3.1) ... Setting libept1.4.12:i386 (1.0.12) ... Setting Aptitude-common (0.6.8.2-1UBUNTU4) ... Setting Libcwidget3 (0.5.16-3.5UBUNTU1) ... Setting aptitude (0.6.8.2-1UBUNTU4) ... update-alternatives:using/usr/bin/aptitude-curses to Provide/usr/bin/aptitude ( Aptitude) in automatic mode processing triggers for Libc-bin (2.19-10UBUNTU2) ... [email protected]:~/work/gitcode/test.new.1$ [email protected]:~/work/gitcode/test.new.1$ [email  Protected]:~/work/gitcode/test.new.1$ [email protected]:~/work/gitcode/test.new.1$ sudo aptitude install Libreadline6-dev The following "new"           The package will be installed. LIBREADLINE6-DEV{B} The following packages will be "deleted": Libjs-sphinxdoc{u} Libnetpbm10{u} Libqt4-core{u} Libqt4-gui{u} Libqt5quickparticles5{u} libqt5quicktest5{u} libqt5quickwidgets5{u} netpbm{u} Php-tcpdf{u} Thunderbird-locale-en{u} Thunderbird-locale-en-gb{u} thunderbird-locale-en-us{u} Thunderbird-locale-zh-cn{u} Thunderbird-locale-zh-hans{u} 0 Packages are upgraded, 1 new installations, 14 will be removed, and 102 will not be upgraded. You need to obtain an archive of 207 KB. 19.2 MB will be released after unpacking. The following packages have unsatisfied dependencies: Libreadline6-dev: dependent: libreadline6 (= 6.3-4UBUNTU2) but 6.3-8UBUNTU1 is installed. The following actions will resolve these dependencies: keep the following packages in their current version: 1) Libreadline6-dev [not installed] accept this solution? [y/n/q/?] n the following actions will resolve these dependencies: downgrade the following packages: 1) libreadline6 [6.3-8UBUNTU1 (now)-6.3- 4UBUNTU2 (trusty)] Do you accept this solution? [y/n/q/?]  Y the following packages will be "degraded": Libreadline6 the following "new" packages will be installed. Libreadline6-dev The following packages will be "deleted": Libjs-sphinxdoc{u} Libnetpbm10{u} Libqt4-core{u} LIBQT4-gui{u} libqt5quickparticles5{u} libqt5quicktest5{u} libqt5quickwidgets5{u} Netpbm{u} Php-tcpdf{u}   Thunderbird-locale-en{u} thunderbird-locale-en-gb{u} Thunderbird-locale-en-us{u} Thunderbird-locale-zh-cn{u} THUNDERBIRD-LOCALE-ZH-HANS{U} 0 Packages are upgraded, 1 new installations, 1 are demoted, 14 will be deleted, and 102 will not be upgraded. You need to obtain an archive of 318 KB. 19.2 MB will be released after unpacking. Do you want to continue? [y/n/?] Y read: 1 http://cn.archive.ubuntu.com/ubuntu/trusty/main libreadline6 i386 6.3-4UBUNTU2 [111 KB] read: 2/HTTP                                         Cn.archive.ubuntu.com/ubuntu/trusty/main Libreadline6-dev i386 6.3-4UBUNTU2 [207 KB]                                                                                                          Downloaded 318 KB, time 15 seconds (20.0 kb/s) (Reading Database ... The system currently has a total of 236,310 files and directories installed. ) removing Libjs-sphinxdoc (1.2.2+DFSG-1UBUNTU2) ... removing NETPBM (2:10.0-15.1) ... removing LIBNETPBM10 (2:10.0-15.1) ... removing Libqt4-core (4:4.8.6+GIT49-GBC62005+DFSG-1UBUNTU1) ... removing Libqt4-gui (4:4.8.6+GIT49-GBC62005+DFSG-1UBUNTU1) ... removingLibqt5quickparticles5:i386 (5.3.0-3ubuntu13) ... removing libqt5quicktest5:i386 (5.3.0-3ubuntu13) ... removing libqt5quickwidgets5:i386 (5.3.0-3ubuntu13) ... removing php-tcpdf (6.0.048+dfsg-2) ... removing THUNDERBIRD-LOCALE-EN-GB (1:31.6.0+build1-0ubuntu0.14.10.1) ... removing thunderbird-locale-en-us (1:31.6.0+build1-0ubuntu0.14.10.1) ... removing thunderbird-locale-en (1:31.8.0+build1-0ubuntu0.14.10.1) ... removing THUNDERBIRD-LOCALE-ZH-CN (1:31.6.0+build1-0ubuntu0.14.10.1) ... removing Thunderbird-locale-zh-hans (1:31.8.0+build1-0ubuntu0.14.10.1) ... Processing triggers for man-db (2.7.0.2-2) ... Processing triggers for Libc-bin (2.19-10UBUNTU2) ... dpkg: Warning: Downgrading libreadline6:i386 from 6.3-8UBUNTU1 to 6.3-4UBUNTU2 (Reading Database ... The system currently has a total of 235,426 files and directories installed. ) Preparing to unpack .../libreadline6_6.3-4ubuntu2_i386.deb ... Unpacking libreadline6:i386 (6.3-4UBUNTU2) over (6.3-8UBUNTU1) ... Setting libreadline6:i386 (6.3-4UBUNTU2) ... Processing triggers for Libc-bin (2.19-10UBUNTU2) ... Selecting PreviousLy unselected package libreadline6-dev:i386. (Reading Database ... The system currently has a total of 235,426 files and directories installed. ) Preparing to unpack .../libreadline6-dev_6.3-4ubuntu2_i386.deb ... Unpacking libreadline6-dev:i386 (6.3-4UBUNTU2) ...                                 Processing triggers for install-info (5.2.0.dfsg.1-4) ... Current status: 102 updated [-5].

The difference and connection between aptitude and Apt-get in Ubuntu (Debian)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.