LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   apt-get vs. aptitude (https://www.linuxquestions.org/questions/debian-26/apt-get-vs-aptitude-363365/)

freddie_leaf 09-14-2005 02:02 PM

apt-get vs. aptitude
 
I'm running Sarge v3.1

Being new to Debian I'm doing alot of reading. I'm finding seemingly conflicting infomation, but I think it is related to the different releases (potatoe, woody, sarge..).

Some docs say to use 'apt-get', some say to use 'aptitide'.

Is it correct that if I'm using Sarge I should be using aptitude and not apt-get? aptitude seems to be more comprehnsive with regards to package install and cleanup after deleting a package. What are the other differences?

spooon 09-14-2005 02:27 PM

aptitude is a curses (terminal-based) front-end for apt. It allows you to interactively pick packages in an interactive interface rather than specifying it in a command on the command line (like with apt-get). If you want a similar front-end but with GUI, you can use synaptic.

aysiu 09-14-2005 02:38 PM

Here are some images, so you can see the difference (they all perform the same function):

Synaptic Package Manager
Aptitude
apt-get

McCloud 09-14-2005 03:16 PM

You can also run aptitude from the command line. For example
aptitude update
aptitude upgrade
aptitude dist-upgrade

Aptitude is said to deal with dependencies better than apt-get. For example, say you install a package which automatically installs some library packages because it depends on them. When you remove this package with apt-get, it won't remove the libraries this package installed, although they aren't used anymore.

When you install that package with aptitude and remove it with aptitude, aptitude 'detects' that those library packages aren't used anymore and will therefore automatically remove thm.

I myself switched from apt-get to aptitude.

Dead Parrot 09-14-2005 04:25 PM

One nice feature in aptitude: it keeps a log of its actions in /var/log/aptitude . Apt-get doesn't keep any log, I don't know about synaptic.

ironwalker 09-14-2005 05:10 PM

Quote:

Originally posted by McCloud
You can also run aptitude from the command line. For example
aptitude update
aptitude upgrade
aptitude dist-upgrade

Aptitude is said to deal with dependencies better than apt-get. For example, say you install a package which automatically installs some library packages because it depends on them. When you remove this package with apt-get, it won't remove the libraries this package installed, although they aren't used anymore.

When you install that package with aptitude and remove it with aptitude, aptitude 'detects' that those library packages aren't used anymore and will therefore automatically remove thm.

I myself switched from apt-get to aptitude.

True indeed.I also only use aptitude.


Usage: aptitude [-S fname] [-u|-i]
aptitude [options] <action> ...
Actions (if none is specified, aptitude will enter interactive mode):

install - Install/upgrade packages
remove - Remove packages
purge - Remove packages and their configuration files
hold - Place packages on hold
unhold - Cancel a hold command for a package
markauto - Mark packages as having been automatically installed
unmarkauto - Mark packages as having been manually installed
forbid-version - Forbid aptitude from upgrading to a specific package version.
update - Download lists of new/upgradable packages
upgrade - Perform a safe upgrade
dist-upgrade - Perform an upgrade, possibly installing and removing packages
forget-new - Forget what packages are "new"
search - Search for a package by name and/or expression
show - Display detailed information about a package
clean - Erase downloaded package files
autoclean - Erase old downloaded package files
changelog - View a package's changelog
download - Download the .deb file for a package

Options:
-h This help text
-s Simulate actions, but do not actually perform them.
-d Only download packages, do not install or remove anything.
-P Always prompt for confirmation or actions
-y Assume that the answer to simple yes/no questions is 'yes'
-F format Specify a format for displaying search results; see the manual
-O order Specify how search results should be sorted; see the manual
-w width Specify the display width for formatting search results
-f Aggressively try to fix broken packages.
-V Show which versions of packages are to be installed.
-D Show the dependencies of automatically changed packages.
-Z Show the change in installed size of each package.
-v Display extra information. (may be supplied multiple times)
-t [release] Set the release from which packages should be installed
-o key=val Directly set the configuration option named 'key'
--with(out)-recommends Specify whether or not to treat recommends as
strong dependencies
-S fname: Read the aptitude extended status info from fname.
-u : Download new package lists on startup.
-i : Perform an install run on startup.

Also what I like is you can have multiple links in your repository for each section.Aptitude will scan through all the available links and retrieve whatever is available for update.
It just handles pakages better than apt-get.I never use the ncurses version but only via command line.I used ncurses once to set some preferences but thats it.I turn off "remove unused pakages" all the time,I dont like when it does this.
Another note,make sure if you use aptitude you stick with aptitude.Useing another manager to remove a pakage will just make aptitude install it automatically next time.

If you want to browse pakages just use kpakage since it comes with kde(if you use kde) then install with aptitude.Or browse via apt-cache search

freddie_leaf 09-14-2005 08:17 PM

Thanks everyone. This makes is great info.

Xian 09-14-2005 09:01 PM

Quote:

Originally posted by Dead Parrot
Apt-get doesn't keep any log, I don't know about synaptic.
A log of system package changes is kept in /var/log/dpkg. It is not provided by apt, but when apt installs, configures, removes, etc. any package it is recorded in that log in Debian.

Tons of Fun 09-14-2005 09:20 PM

All three packages do the same bottom line, just in different ways with different options. I don't think one is better than the other, it is all personal preference. I have used apt from the beginning, and I love it. It is the most archaic, and doesn't automatically load dependencies like aptitude or synaptic, but it does list the dependencies which you can manually install if you wish. I have grown quite fond of apt, and studied the apt how-to constantly for the first month I was running Debian.

No matter which package manager you wish to use, just keep one thing in mind, do not switch back and forth. The three P.M.'s do not keep track of each other; so if you use apt for the first 6 months, and then try aptitude, it will try uninstalling all of the packages you have installed over the previous 6 months. Many a poor soul has made the mistake thinking that aptitude knew what it was doing.

Like I said, apt doesn't have all of the features that the other two have, but you do have the same capabilities. Apt will remove most dependencies if you remove with --purge. To keep dependencies clean, you have debfoster, deborphan, and autoclean. And to keep buggy packages from getting installed, you have apt-listbugs, and like Xian said, a system log is kept at /var/log/dpkg. The bottom line is to find one that works for you and have fun with it.

:study:

Dead Parrot 09-14-2005 09:28 PM

Quote:

Posted by Xian
A log of system package changes is kept in /var/log/dpkg. It is not provided by apt, but when apt installs, configures, removes, etc. any package it is recorded in that log in Debian.
Thanks, I hadn't noticed that. Still, I prefer to read the aptitude log if I need to recall what packages I installed/upgraded/removed a week ago. ;)

Xian 09-14-2005 09:44 PM

If you want to use Apt and install suggested/reccomended packages, as well as remove orphaned files then you can use the wajig tool.

Code:

$ apt-get install wajig
$ wajig installrs <pkg>      #install sug/req'd pkgs
$ wajig list-orphans        #List libs not req'd by any pkg
$ wajig purge-depend <pkg>      #Purge pkg & deps not required by others
$ wajig purge-orphans      #Purge orphaned libraries


Dead Parrot 09-14-2005 10:00 PM

Or, if you want to configure aptitude to install both recommended & suggested packages, or to not install them, see my post in this thread:

http://www.linuxquestions.org/questi...hreadid=363282

Xian 09-14-2005 10:10 PM

You can also set-up Synaptic to show orphaned packages which can be selected for removal. Here's the quick how-to:

From the main toolbar in Synaptic goto
Settings > Filters
Click 'New'
Name the filter in the top dialogue box.
The name 'Orphaned' is good choice.

Click 'Delselect All'
Tick 'Orphaned'
Click 'Okay'

Now from the main window:
Click 'Custom' and highlight 'Orphaned'

There will be listed all your orphaned packages.
Review for any that should not be removed.

Purge or remove any others you desire.

Dead Parrot 09-14-2005 10:39 PM

If you use the "interactive" UI of aptitude (by just typing "aptitude"), you can highlight a package and then press Shift + c and this will fetch the changelog for that package and show it in your default pager. I use this feature quite often to decide if I want to upgrade a package or not. I don't know if other frontends for apt have this feature.

aysiu 09-14-2005 10:55 PM

Synaptic has this feature:

Package > Download Changelog

Dead Parrot 09-15-2005 05:22 AM

Synaptic has also a sources.list editor, which aptitude lacks. And you can use various search filters in synaptic while aptitude can perform only very basic (although fast!) package searches. My main gripe against synaptic is that it sorts (at least it did the last time I tried synaptic) packages under strange groups while aptitude follows the same familiar package grouping that you can find in the official web interface: http://www.debian.org/distrib/packages

E.guedes 10-01-2008 09:27 PM

If I install anything using apt-get and its dependences, then if I remove that using aptitude will it remove everything?? Thanks.

rickh 10-01-2008 09:42 PM

Quote:

Originally Posted by E.guedes (Post 3297582)
If I install anything using apt-get and its dependences, then if I remove that using aptitude will it remove everything?? Thanks.

No. And reviving long dead threads is juvenile and unhelpful.

wykedengel 12-16-2008 09:00 AM

Quote:

Originally Posted by rickh (Post 3297584)
No. And reviving long dead threads is juvenile and unhelpful.

I disagree. I would neither thought of this particular matter nor found thread had this post been revived. I am not an expert, I would know terminal from turkey. I am learning. Any place I can learn is a big help. So, yes, it can be useful.

the_guv 10-09-2009 02:20 AM

is worth noting that Synaptic is a front end for apt-get .. or is that changing with Koala's newly branded apps shop or whatever it's called?

.. so if you use synaptic to install/remove stuff, you are apt-getting, as opposed to aptituding, if you'll excuse the ings n tings.

then again, maybe apt-get and aptitude are more cooperational these days anyhow .. with a full upgrade twice a year, if you elect to fupgrade, I guess it clears a lot of cobwebs.

.. also, gtkorphan is a worthy install. it finds orphaned packages for safe removal. great for those with LTS editions or appoholics.

milomak 10-10-2009 09:42 AM

i've just always found the console my preferred upgrade method

budhajeewa 12-19-2009 06:26 PM

Quote:

Originally Posted by McCloud (Post 1852477)
Aptitude is said to deal with dependencies better than apt-get. For example, say you install a package which automatically installs some library packages because it depends on them. When you remove this package with apt-get, it won't remove the libraries this package installed, although they aren't used anymore.

When you install that package with aptitude and remove it with aptitude, aptitude 'detects' that those library packages aren't used anymore and will therefore automatically remove thm.

Won't apt-get do the same with "autoremove" (sudo apt-get autoremove) ?

joutlancpa 01-11-2011 09:39 PM

Yes apt-get will with 'autoremove'. Aptitude isn't the best anymore, IMO. Apt-get with Synaptic combined is awesome and I use it exclusively. Debian and Sidux have recommended apt-get a long time. I think at one point Aptitude was preferable a few years ago, but the perpetuation of that has become a myth ....I'm going to RHEL anyway so who cares :)

AlucardZero 01-12-2011 12:59 PM

No, Debian still recommends aptitude over apt-get.. and has for years.

the trooper 01-12-2011 02:06 PM

Quote:

I'm going to RHEL anyway so who cares
So why are you trolling the Debian forum with your opinion?.
Not to mention dragging up an old thread.

demosthenese 01-12-2011 02:36 PM

Quote:

Originally Posted by AlucardZero (Post 4221953)
No, Debian still recommends aptitude over apt-get.. and has for years.

For some loose definition of 'still'. The reference you give relates to upgrading etch to lenny. The current Debian GNU/Linux FAQ, http://www.debian.org/doc/FAQ/ch-pkgtools.en.html makes no reference to a preferred tool. In fact a telling line is:

Quote:

It is important to understand that the higher level package management tools such as aptitude or dselect rely on apt which, itself, relies on dpkg to manage the packages in the system.
I think that once upon a time it mattered whether you used apt-get or aptitude but it is now all the same under the hood.

Edit: I really must read ore carefully:

From the FAQ

Quote:

Note that apt-get now installs recommended packages as default and is the preferred program for package management from console to perform system installation and major system upgrades for its robustness.
Quote:

Note that aptitude is the preferred program for daily package management from console.

joutlancpa 01-12-2011 05:17 PM

Quote:

Originally Posted by the trooper (Post 4222028)
So why are you trolling the Debian forum with your opinion?.
Not to mention dragging up an old thread.

I'm still using Debian...the only troll post I see is yours. Guess I was wrong about what Debian recommends, but that's all. I abhor Aptitude after a few years with it. Just my opinion, and others as well....such as the AptoSid folks.

AlucardZero 01-12-2011 05:40 PM

@demosthenese Lenny is still stable, so it's not that out of date in Debian terms. Thanks for the link you found though.

the trooper 01-13-2011 06:56 AM

Quote:

the only troll post I see is yours
And you have decided to ignore the points I made.Never mind.

Quote:

Guess I was wrong about what Debian recommends
Partially.
And the apt-get versus aptitude debate will continue.

Quote:

I abhor Aptitude after a few years with it
Then don't use it.Simple.

Quote:

Just my opinion, and others as well...
Which goes back to the first line of my first post.

Quote:

such as the AptoSid folks.
So go tell them how much you like apt-get and how aptitude sucks,you'll fit right in.


All times are GMT -5. The time now is 07:08 PM.