6

I have been using apt-get for some years on Ubuntu now, and tried aptitude a few times. I have read in some blogs that once you have used one of the tools on your system, you should stick to it and not use the other because they don't work the same way and it would lead to problems.

Now, after reading What's the difference between apt-get and aptitude?, I can't see why.

So is it true ? And in that case, with systems like Ubuntu including an automatic update probably using apt-get under the hood, is it even recommended to use aptitude ?

e-satis
  • 409
  • 5
  • 17

7 Answers7

3

Well, aptitude is more modern, and has at least one feature that apt-get lacks: aptitude tracks which packages have been installed due to dependencies (and not by explicit user request) and removes them automatically when the packages that needed them are removed from the system. Edit: Actually, recent versions of apt-get also do this. However, apparently aptitude's conflict resolution is more advanced than apt-get's.

Also note that aptitude is now preferred over apt-get. But apart from the issue noted above both are perfectly compatible and can be used side-by-side.

BTW, note that you can also use aptitude directly from the command line, e.g.

aptitude install foo

So if you only use apt-get for direct installation, you can switch completely to aptitude.

sleske
  • 9,851
  • 4
  • 33
  • 44
3

Here's more (and to me the main reason not to use both):

As I asked in this thread : If, for any reason, you need to hold back a package, meaning you don't want it to be upgraded even if available, there are 2 separate ways of doing it depending on the tool you use :

  • aptitude :

aptitude hold package-name

  • apt-get :

echo "package-name hold" | dpkg --set-selections

It means that if you hold a package with apt-get, when performing "aptitude upgrade" you will end up upgrading the package you wanted to hold previously !

This can be very annoying especially if you're working in a team and if people are using both tools.

Falken
  • 1,682
  • 5
  • 18
  • 27
2

No. You can use both.

Zanchey
  • 3,041
  • 20
  • 28
2

See David Pashley's answer here for more information.

Dennis Williamson
  • 60,515
  • 14
  • 113
  • 148
  • If you are going to just link to someone else's answer, this would be an ideal example of when to make your answer a wiki. – Troggy Nov 23 '09 at 16:56
1

Additionally, aptitude also can take the place of apt-cache. I tend to like using it--if you start it in interactive mode and forget to sudo there's an option to fix that. :)

As of note, I've had aptitude sometimes install recommended or suggested dependencies automatically; you might want to check if you really need a package if it looks suspect (I once had aptitude install postfix after I installed some SMART monitoring tools. I should probably report that as a bug.)

It's easy enough to remove the extra packages if they were recommended/suggested.

Broam
  • 130
  • 6
0

I have an experience that aptitude ran into a conflict with apt-get(one of reasons is package hold mentioned above). In that situation, I remember, apt-get can ran but aptitude told me that a lot of dependency problems needed to be solved and these problems could not be well settled by me.

So now I do only use apt-get.

0

I suggest switching to aptitude: as Sleeke has said it manages better conflict resolution, it offers a ncurses GUI and in the near future it should get a GTK+ GUI.

Andrea de Palo
  • 332
  • 1
  • 5