- what does «sudo apt-get install aptitude» do?
- 4 Answers 4
- What is APT and Aptitude? and What’s real Difference Between Them?
- What is Apt
- What is Aptitude?
- What’s Differences Between APT and Aptitude?
- Searching a package using apt-cache vs Aptitude
- Some other examples of advanced package search with Aptitude
- 2. Finding all packages that provide a particular service
- 3. Finding all packages that suggest a certain package
- Conclusion
what does «sudo apt-get install aptitude» do?
I am completely new to linux and hence Ubuntu. Though i have been using the Ubuntu OS on my system for a while, it is for the first time I am trying to learn the nuances and hence starting with the documentation. I am wondering , if we use apt-get command to install packages, what does apt-get install aptitude do ?
@david6 but actually, aptitude is a front-end for apt-get it’s not the same and doesn’t have the same functions.
I over-simplified: Aptitude offers a curses (text-GUI) interface (when run without parameter) and a command-line interface that can do most things that apt-cache/apt-get does. It has a dependency resolver that let you browse between multiple solutions. When using command line, you can adjust the proposed solution (install or remove a recommended package). However, Aptitude is still based on the libapt library, and depends on apt-get; so you can’t have it installed without apt-get (also in the ‘apt’ package).
4 Answers 4
apt-get install PACKAGE_NAME
Is the command used to install any package you know the name for, like aptitude .
sudo is used to earn root access and be able to install and remove software. sudo is always required if you do system wide changes like installing, removing, updating and upgrading packages.
Is the command used to manage any software and software sources. install is an extra command that tells the computer that you want to install software with the package name as follows. It will then check the software sources for a download link with the same name and then download and install the latest version (or specified version).
will update the sofware sources with new versions of the software listed (not installing anything)
upgrades the software if new versions are available in the software sources.
removes the package name specified after (like install).
there are more useful commands, but these are necessary for getting started with managing software from the terminal.
Aptitude
After more research on aptitude i found out that it’s already installed. So installing aptitude wouldn’t resolve in anything besides errors in the conosle. Start aptitude by:
The aptitude package is a GUI version of the apt-get command, it hasn’t got the full set of features as apt-get but you have the basics like, remove , update , upgrade , install , etc. More information about aptitude and it features can be found here.
Also search in the software center if you want o use a GUI to find and install/uninstall applications.
What is APT and Aptitude? and What’s real Difference Between Them?
Aptitude and apt-get are two of the popular tools which handle package management. Both are capable of handling all kinds of activities on packages including installation, removal, search etc. But still there are differences between both the tools which make users prefer one over the other. What are those differences that make these two tools to be considered separately is the scope of this article.
What is Apt
Apt or Advanced Packaging Tool is a free and open source software which gracefully handles software installation and removal. Initially it was designed for Debian’s .deb packages but it has been made compatible with RPM Package Manager.
Apt is whole command line with no GUI. Whenever invoked from command line along with specifying the name of package to be installed, it finds that package in configured list of sources specified in ‘/etc/apt/sources.list’ along with the list of dependencies for that package and sorts them and automatically installs them along with the current package thus letting user not to worry of installing dependencies.
It is highly flexible allowing User to control various configurations easily, like: adding any new source to search for packages, apt-pinning i.e. marking any package unavailable during system up-gradation thus making its current version be its final version installed, “smart” upgrade i.e. upgrading most important packages and leaving the least important ones.
What is Aptitude?
Aptitude is front-end to advanced packaging tool which adds a user interface to the functionality, thus allowing a user to interactively search for a package and install or remove it. Initially created for Debain, Aptitude extends its functionality to RPM based distributions as well.
Its user interface is based on ncurses library which adds various elements to it commonly seen in GUI’s. One of its highlight is that it can emulate most of apt-get’s command line arguments.
In all, Aptitude is a higher-level package managers that abstracts low level details, and can operate in both text-based interactive UI mode and even in command line non-interactive mode.
If you want know the usage of APT and Aptitude with real world examples, you should head over to the following articles.
What’s Differences Between APT and Aptitude?
Apart from main difference being that Aptitude is a high-level package manager while APT is lower-level package manager which can be used by other higher-level package managers, other main highlights that separate these two package managers are:
- Aptitude is vaster in functionality than apt-get and integrates functionalities of apt-get and its other variants including apt-mark and apt-cache.
While apt-get handles all the package installation, up-gradation, system-upgradation, purging package, resolving dependencies etc., Aptitude handles lot more stuff than apt, including functionalities of apt-mark and apt-cache i.e. searching for a package in list of installed packages, marking a package to be automatically or manually installed, holding a package making it unavailable for up-gradation and so on.
Apt-get being a lower level package manager is restricted only to command line, while Aptitude being a higher-level tool has a default text-only interactive interface along with option of command-line operation by entering required commands.
In many situations involving installation, removal and conflict resolution for packages, Aptitude proves its worth rather than apt-get. Some of the situations include:
1. While removing any installed package, Aptitude will automatically remove unused packages, while apt-get would need user to explicitly specify this by either adding additional option of ‘—auto-remove’ or specifying ‘apt-get autoremove’ .4
2. To investigate further as to why certain action is getting blocked or why or why-not a certain action should be taken, Aptitude offers ‘why’ and ‘why-not’ commands.
Like: Aptitude can find you the reason to install a certain package by looking in the list of installed packages and checking if any of their suggested packages has a dependencies or any of their dependencies suggests that package or so on.
$ aptitude why yaws-wiki i doc-base Suggests dhelp | dwww | doc-central | yelp | khelpcenter4 p dwww Depends apache2 | httpd-cgi p yaws Provides httpd-cgi p yaws Suggests yaws-wiki
Like here it searched for the reason to install a package named ‘yaws-wiki’ to be that it is suggested by a dependency (yaws) which provides a virtual package (httpd-cgi) on which package (dwww) has dependency and package (dwww) is suggested by one of the installed packages named ‘doc-base’ .
This feature is missing in apt-get.
3. While apt-get would probably die-out in case of conflicting action regarding installation or removal of package with a message, Aptitude can suggest possible measures to remove that conflict.
Aptitude provides a powerful search which can be used to search almost any package not only on the system but also on the entire repository.
Whereas apt-get needs another apt’s variant i.e. apt-cache to search for a package, Aptitude provides much easier and efficient way to search for a package which is either installed or present in repository but yet to be installed.
Searching a package using apt-cache vs Aptitude
$ apt-cache search 'python' | head -n4 kate - powerful text editor kcachegrind-converters - format converters for KCachegrind profiler visualisation tool kig - interactive geometry tool for KDE python-kde4 - Python bindings for the KDE Development Platform $ aptitude search 'python' | head -n4 i bpython - fancy interface to the Python interpreter p bpython-gtk - fancy interface to the Python interpreter p bpython-urwid - fancy interface to the Python interpreter p bpython3 - fancy interface to the Python3 interpreter
Here, by default both apt-cache and aptitude search for a package on whole list of packages in repository, but output of aptitude shows whether the package is installed on the system or not by giving a per-package flag which here is ‘p’ indicating that package is present but not installed and ‘i’ which indicates that the package is installed, whereas apt-cache just lists the package and its one-line detail without telling if package is installed or not.
Some other examples of advanced package search with Aptitude
1. Searching for a package in repository with ‘python2.7’ in the name of package and ‘2.7’ in its description.
$ aptitude search '~npython2.7 ~d2.7' p idle-python2.7 - IDE for Python (v2.7) using Tkinter i libpython2.7 - Shared Python runtime library (version 2.7 p libpython2.7:i386 - Shared Python runtime library (version 2.7 p libpython2.7-dbg - Debug Build of the Python Interpreter (ver p libpython2.7-dbg:i386 - Debug Build of the Python Interpreter (ver i A libpython2.7-dev - Header files and a static library for Pyth p libpython2.7-dev:i386 - Header files and a static library for Pyth i libpython2.7-minimal - Minimal subset of the Python language (ver p libpython2.7-minimal:i386 - Minimal subset of the Python language (ver i libpython2.7-stdlib - Interactive high-level object-oriented lan p libpython2.7-stdlib:i386 - Interactive high-level object-oriented lan p libpython2.7-testsuite - Testsuite for the Python standard library i python2.7 - Interactive high-level object-oriented lan p python2.7:i386 - Interactive high-level object-oriented lan p python2.7-dbg - Debug Build of the Python Interpreter (ver p python2.7-dbg:i386 - Debug Build of the Python Interpreter (ver i A python2.7-dev - Header files and a static library for Pyth p python2.7-dev:i386 - Header files and a static library for Pyth p python2.7-doc - Documentation for the high-level object-or p python2.7-examples - Examples for the Python language (v2.7) i python2.7-minimal - Minimal subset of the Python language (ver p python2.7-minimal:i386 - Minimal subset of the Python language (ver
Here ‘~n’ indicates name and ‘~d’ indicates description. Other form of same command is:
$ aptitude search '?name(python2.7) ?description(2.7)'
Some other flags include:
- ~i or ?installed() : Searching for a package in the list of installed packages only.
- ~U or ~Upgradable : Lists all the packages which are upgradable with their latest available versions.
- ~E or ?Essential() : Those packages either installed or available, which are essential.
$ aptitude versions '?Upgradable' | head -n 12 Package apache2: ph 2.4.7-1ubuntu4 trusty 500 ph 2.4.7-1ubuntu4.5 trusty-security 500 ih 2.4.7-1ubuntu4.8 100 ph 2.4.7-1ubuntu4.9 trusty-updates 500 Package apache2-bin: p A 2.4.7-1ubuntu4 trusty 500 p A 2.4.7-1ubuntu4.5 trusty-security 500 i A 2.4.7-1ubuntu4.8 100 p A 2.4.7-1ubuntu4.9 trusty-updates 500
Like a short list shown here of 3 packages with installed version (indicated with ‘i’ ) and their upgradable version present (indicated with ‘p’ ).
2. Finding all packages that provide a particular service
To find all packages those provide smtp service:
$ aptitude search '?provides(smtp)' p libghc-smtpclient-dev - Simple Haskell SMTP client library p libghc-smtpclient-dev:i386 - Simple Haskell SMTP client library p libghc-smtpclient-prof - Simple Haskell SMTP client library; profil p libghc-smtpclient-prof:i386 - Simple Haskell SMTP client library; profil p syslog-ng-mod-smtp - Enhanced system logging daemon (SMTP plugi p syslog-ng-mod-smtp:i386 - Enhanced system logging daemon (SMTP plugi
3. Finding all packages that suggest a certain package
Like here, we list all packages that suggest ‘gcc’ package.
$ aptitude search '~DSuggests:gcc' | head -n10 p bochs - IA-32 PC emulator p bochs:i386 - IA-32 PC emulator p cpp-4.4 - GNU C preprocessor p cpp-4.4:i386 - GNU C preprocessor p cpp-4.6 - GNU C preprocessor p cpp-4.6:i386 - GNU C preprocessor p cpp-4.7 - GNU C preprocessor p cpp-4.7:i386 - GNU C preprocessor p cpp-4.7-arm-linux-gnueabi - GNU C preprocessor p cpp-4.7-arm-linux-gnueabi:i386 - GNU C preprocessor
Conclusion
So, for most of the cases, syntax of Aptitude is kept almost same as that of apt-get, to make users of apt-get have less pain in migrating to Aptitude, but in addition to this, many powerful features are integrated in Aptitude that make it the one to be chosen. Apart from these differences that we highlighted, if you find any other interesting differences between these two package managers, do mention them in your comments.