News for hackers. Stuff that matters.
Re:Linux Package Manager Command Line Comparison by bradleyland on Thursday January 26, 2012 @09:45AM (#3514315)
Most Debian/Ubuntu admins I know use aptitude these days, rather than apt-<tool> directly.
Re:Linux Package Manager Command Line Comparison by pavelkaroukin on Thursday January 26, 2012 @11:33AM (#3514727)
Could you please elaborate or give a link to article(s) about why aptitude is better?
Re:Linux Package Manager Command Line Comparison by monkeyfacebag on Thursday January 26, 2012 @11:44AM (#3514779)
Aptitude handles package removal, especially orphaned dependencies much better. I think it's now included in the Debian base system, so there's very little reason to prefer apt.
Re:Linux Package Manager Command Line Comparison by saghul on Thursday January 26, 2012 @12:15PM (#3514936)
I actually use apt-get because I like to keep my system with the least amount of packages installed. I don't need any of the "recommended" packages, and if I do I'd install them manually.

Also, I usually use deborphan to find orphaned packages and remove them, if apt-get autoremove didn't find them.

Re:Linux Package Manager Command Line Comparison by Tobu on Thursday January 26, 2012 @01:01PM (#3515152)
Recommends are handled the same way by both tools nowadays. There are configuration options and flags to switch them off it you prefer.
Re:Linux Package Manager Command Line Comparison by sciurus on Thursday January 26, 2012 @02:04PM (#3515443)
You probably already know this, but apt-get defaults to installing recommended packages since Debian Lenny. Ubuntu may have been doing it for longer. To disable this, you have to set 'APT::Install-Recommends "false";' in apt.conf
Re:Linux Package Manager Command Line Comparison by technomancy on Thursday January 26, 2012 @01:48PM (#3515363)
I tried switching to aptitude, but the fact that its search defaults to OR for terms rather than AND made it completely unusable.

I guess I could keep using apt-cache for searching and aptitude for installation/removal though.

Re:Linux Package Manager Command Line Comparison by stouset on Thursday January 26, 2012 @05:43PM (#3516308)
What? Its search is a regex, plain and simple.
Re:Linux Package Manager Command Line Comparison by nodata on Thursday January 26, 2012 @08:59AM (#3514110)
The yum stuff is missing parts...

Use some magic to fix broken dependencies in a system: yum distro-sync or yum check and decide.

Remove dependencies that are no longer needed: package-cleanup --orphans

Downloads the corresponding source package(s) to the given package name(s): yumdownloader --source PACKAGENAME

etc.

Re:Linux Package Manager Command Line Comparison by l0nk on Thursday January 26, 2012 @09:09AM (#3514156)
If you think something is missing feel free to add it =)

And regarding the speed, well I got a server under Archlinux et another one under Debian, they have the same age (around 1 year ago, when squeeze come out) and pacman is more more quicker!

Re:Linux Package Manager Command Line Comparison by nicktelford on Thursday January 26, 2012 @09:43AM (#3514309)
I can't believe there are Debian/Ubuntu folks still not using "aptitude". Or that it's not installed by default.
Re:Linux Package Manager Command Line Comparison by Mavrik on Thursday January 26, 2012 @09:49AM (#3514332)
I've been using Ubuntu with apt-get for quite a few years now. What additional funcionality does aptitude offer over "plain" apt-get?
Re:Linux Package Manager Command Line Comparison by obtu on Thursday January 26, 2012 @11:30AM (#3514708)
My favourite feature is the search capabilities, which are well integrated and extremely powerful.

    # installed packages with yaml in the name
    aptitude search '~i yaml'

    # installed packages requiring yaml
    # (~D means depends on)
    aptitude search '~i ~D yaml'

    # packages whose name starts with lib and
    # mentioning SQL in their descriptions
    aptitude search '^lib ~d sql'

    # installed packages from some non-standard repo
    # apt-cache policy describes package origins
    aptitude search '~i ?origin(apt.opscode.com)'

    # why is libvirt0 installed?
    aptitude why libvirt0

    # which ubuntu metapackage is keeping libvirt0 installed?
    aptitude why '~i ubun' libvirt0 

    # don't keep any transitional package installed
    sudo aptitude markauto '~i ~d transitional'

    # purge ganeti packages
    sudo aptitude purge '~i ganeti'
Re:Linux Package Manager Command Line Comparison by nicktelford on Thursday January 26, 2012 @12:26PM (#3514997)
I didn't know about this matching. Awesome.

Now I'm even more annoyed that our servers are all CentOS :(

Re:Linux Package Manager Command Line Comparison by nicktelford on Thursday January 26, 2012 @09:53AM (#3514344)
The biggest advantage is when removing packages; its dependency resolution is (supposedly) much better so it's able to find and remove orphan packages more accurately without hosing your system.

It's also got a much friendlier set of commands:

  $ apt-get upgrade vim # aptitude upgrade vim

  $ apt-get dist-upgrade # aptitude full-upgrade

  $ apt-cache search # aptitude search

  $ apt-get install --reinstall vim # aptitude reinstall vim

  $ apt-get remove --purge vim # aptitude purge vim
The list goes on.

It's also got an awesome ncurses based interactive interface if you just type:

  $ aptitude
Great for sysadmins who miss synaptic or anyone who feels like a GUI is just too mainstream.
Re:Linux Package Manager Command Line Comparison by ernesth on Thursday January 26, 2012 @10:19AM (#3514436)
apt-get also is able to remove orphaned libraries.

Among other "advantages" of aptitude, it can be terribly slower than apt-get. And it has a "smart" dependency engine that often proposes convoluted solutions (involving uninstalling packages I don't want uninstalled) when apt-get will simply update the dependency and their dependents... But at least, if you don't agree with the first solutions, it has others (sometimes including the one apt-get chooses).

Re:Linux Package Manager Command Line Comparison by bostonvaulter2 on Thursday January 26, 2012 @02:01PM (#3515429)
What's the history of the aptitude and apt-* family of commands? Why do they both exist?
Re:Linux Package Manager Command Line Comparison by sciurus on Thursday January 26, 2012 @02:17PM (#3515508)
Re:Linux Package Manager Command Line Comparison by JoshTriplett on Thursday January 26, 2012 @10:21AM (#3514444)
Aptitude has an optional screen-oriented GUI, much better search and filtering capabilities, a listing of "new" packages each time you update, and an excellent dependency resolver.
Re:Linux Package Manager Command Line Comparison by jff on Thursday January 26, 2012 @02:17PM (#3515509)
I ran "aptitude dist-upgrade" on my netbook once.

It ate up the entire 1 GB of RAM and got OOM killed before it could finish computing dependencies.

I shouldn't need a swap partition just to update packages. So now I use apt-get if I'm upgrading a lot of packages at once. aptitude for other tasks.

Re:Linux Package Manager Command Line Comparison by obtu on Thursday January 26, 2012 @11:16AM (#3514655)
On Debian, I definitely use aptitude. However it hasn't been updated for Ubuntu's recent work on multiarch, and thus actions requiring dependency resolution are not usable anymore on many Oneiric installs (those that are amd64 with a few i586 packages).
Re:Linux Package Manager Command Line Comparison by sciurus on Thursday January 26, 2012 @02:10PM (#3515477)
I think there's a perception that aptitude can be to smart for its own good. From the Debian Reference:

"Although the aptitude command comes with rich features such as its enhanced package resolver, this complexity has caused (or may still causes) some regressions such as Bug #411123, Bug #514930, and Bug #570377. In case of doubt, please use the apt-get and apt-cache commands over the aptitude command."

http://www.debian.org/doc/manuals/debian-reference/ch02.en.h...

Re:Linux Package Manager Command Line Comparison by klodolph on Thursday January 26, 2012 @08:43AM (#3514045)
Someone should mention package manager performance. Searching for a package in an Arch system will take a long time (10s or more) except on relatively fresh installs. It may have been fixed by now, but it was a serious point of irritation.
Re:Linux Package Manager Command Line Comparison by Avshalom on Thursday January 26, 2012 @08:59AM (#3514108)
Were you using XFS at the time? Search has never been a problem for me even on multi year old installs, but there was (is?) something about XFS that made pacman slow to a crawl.
Re:Linux Package Manager Command Line Comparison by klodolph on Thursday January 26, 2012 @09:05AM (#3514142)
Nope. The problem happened on multiple systems (i386, x64) regardless of filesystem (ext3, reiser), although problems only start after a few months. I found a bug in the bug tracker for it with multiple people confirming it and the "solution" was to wipe the package database manually every once in a while.
Re:Linux Package Manager Command Line Comparison by mziulu on Thursday January 26, 2012 @09:49AM (#3514327)
In case someone else finds himself hitting this performance slowdown, try this: http://aur.archlinux.org/packages.php?ID=32483
Re:Linux Package Manager Command Line Comparison by clhodapp on Thursday January 26, 2012 @11:21AM (#3514677)
Running pacman-optimize (part of the base pacman package) occasionally keeps the performance at an acceptable level for me.
Re:Linux Package Manager Command Line Comparison by lclarkmichalek on Thursday January 26, 2012 @11:11AM (#3514632)
Personally I use the zsh completion for pacman over pacman -S as it is much faster
Re:Linux Package Manager Command Line Comparison by virtualritz on Thursday January 26, 2012 @11:53PM (#3517197)
Critically misses the most advanced package manager currently available: Paludis. http://paludis.exherbo.org/
Re:Linux Package Manager Command Line Comparison by phunehehe on Thursday January 26, 2012 @09:47AM (#3514320)
Hah! So there is something on the front page of HN that I have referred to for years :)
Re:Linux Package Manager Command Line Comparison by g3orge on Thursday January 26, 2012 @09:00AM (#3514112)
I was waiting something like that for a long time.