What is the difference between apt get and aptitude




















If you want know the usage of APT and Aptitude with real world examples, you should head over to the following articles. 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:.

While apt-get handles all the package installation, up-gradation, system-upgradation, purging package, resolving dependencies etc. 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:. 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. 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'.

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. 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.

Searching for a package in repository with 'python2. Other form of same command is:. Like a short list shown here of 3 packages with installed version indicated with 'i' and their upgradable version present indicated with 'p'.

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.

TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! The chosen method. Managing Package Priorities. One of the most important aspects in the configuration of APT is the management of the priorities associated with each package source.

For instance, you might want to extend one distribution with one or two newer packages from Testing , Unstable or Experimental. It is possible to assign a priority to each available package the same package can have several priorities depending on its version or the distribution providing it. These priorities will influence APT's behavior: for each package, it will always select the version with the highest priority except if this version is older than the installed one and if its priority is less than APT defines several default priorities.

Each installed package version has a priority of A non-installed version has a priority of by default, but it can jump to if it is part of the target release defined with the -t command-line option or the APT::Default-Release configuration directive.

APT will never install an older version of a package that is, a package whose version number is lower than the one of the currently installed package except if its priority is higher than or it is explicitely requested by the user, see Section 6. APT will always install the highest priority package which follows this constraint.

If two packages have the same priority, APT installs the newest one whose version number is the highest. If two packages of same version have the same priority but differ in their content, APT installs the version that is not installed this rule has been created to cover the case of a package update without the increment of the revision number, which is usually required. If several generic entries exist, the first match is used.

The available selection criteria include the package's name and the source providing it. Every package source is identified by the information contained in a Release file that APT downloads together with the Packages files. It also gives the name of the distribution usually Stable , Testing , Unstable or Experimental for the standard distributions provided by Debian together with its version for example, 10 for Debian Buster.

Let's have a look at its syntax through some realistic case studies of this mechanism. If you listed Experimental in your sources. This is of course a specific case, designed to keep users from installing Experimental packages by mistake. It is still possible though not recommended to treat packages of Experimental like those of other distributions by giving them a priority of Let's suppose that you only want to use packages from the stable version of Debian.

Those provided in other versions should not be installed except if explicitly requested. Let's now assume that you have a server with several local programs depending on the version 5. You could use this entry:. Package: perl Pin: version 5. To gain a better understanding of the mechanisms of priority and distribution or repository properties to pin do not hesitate to execute apt-cache policy to display the default priority associated with each package source, or apt-cache policy package to display the default priority for each available version and source of a package as explained in TIP apt-cache policy.

Working with Several Distributions. For example, after having installed a Stable system, you might want to try out a software package available in Testing or Unstable without diverging too much from the system's initial state. Even if you will occasionally encounter problems while mixing packages from different distributions, apt manages such coexistence very well and limits risks very effectively. Let's suppose that Stable is your reference distribution but that Testing and Unstable are also listed in your sources.

If the installation fails due to some unsatisfiable dependencies, let it solve those dependencies within Testing by adding the -t testing parameter. The same obviously applies to Unstable. In this situation, upgrades upgrade and full-upgrade are done within Stable except for packages already upgraded to another distribution: those will follow updates available in the other distributions.

We will explain this behavior with the help of the default priorities set by APT below. Do not hesitate to use apt-cache policy see sidebar TIP apt-cache policy to verify the given priorities. Let's assume that you have installed version 1 of a first package from Stable and that version 2 and 3 are available respectively in Testing and Unstable. The installed version has a priority of but the version available in Stable the very same has a priority of because it is part of the target release.

Packages in Testing and Unstable have a priority of the default priority of a non-installed version. The winner is thus version 1 with a priority of Let's take the example of another package whose version 2 has been installed from Testing. Version 1 is available in Stable and version 3 in Unstable. Version 1 of priority — thus lower than is discarded because it is lower than the installed version. This only leaves version 2 and 3, both of priority Faced with this alternative, APT selects the newest version, the one from Unstable.

If you don't want a package installed from Testing to migrate to Unstable , you have to assign a priority lower than for example to packages coming from Unstable. Tracking Automatically Installed Packages.

One of the essential functionalities of apt is the tracking of packages installed only through dependencies. In all cases, the tools display a clear message listing the affected packages. It only takes a minute to sign up. Connect and share knowledge within a single location that is structured and easy to search.

I don't get why there are two different programs in a minimal install to install software. Don't they do the same thing? Is there a big difference? I have read everywhere to use aptitude over apt-get but I still don't know the difference. A few examples that apt might not supply:. The official tool that is currently used within the Debian installer and recommended in the release notes is aptitude.

It also has a better dependency resolver that let you browse between multiple solutions. Even when using the command line version, you can interact with the proposed solution and give supplementary orders or hints like installing or removing a package that is recommended by another one. But aptitude is based on the libapt library it's not a direct wrapper of dpkg and as such it depends on the apt package so you can't have aptitude installed without apt-get which is also in the apt package.

Another diagram presents the information stored by the various package management tools: A map of the apt and dpkg state files.

You can also read my article apt-get, aptitude, … pick the right package manager for you. Upon removal of a package aptitude will remove those automatically installed packages to keep your system tidy. Imagine you are working with backports. Then aptitude will show at the bottom of the details page of a certain package the available version number and allow you to select one.

If you get into a situation where programs conflict due to such usage of unofficial repositories you will see a "Broken Makes it much easier to resolve the conflict manually. Furthermore you can use " l " to limit the package list. Choose a "flat package list" from the menu and you will get reach your goal quickly. The complete handbook is very large, offering you many more filters and possibilities. Even if you don't know them aptitude is a handy replacement for apt-get and you can use it with common parameters like:.

The biggest difference is that aptitude is designed to be interactive where the apt tools are better suited for scripting work. You can use the latter, i. If you had to settle on just one tool or the other for some reason then you need to decide how much effort you want to put into your package management.

One of the serious advantages of aptitude is its ability to calculate dependencies.



0コメント

  • 1000 / 1000