|
|
Subscribe / Log in / New account

Housekeeping utilities for Debian packages (Linux.com)

Bruce Byfield discusses some lesser-known Debian package management tools in a Linux.com article. "For all the efficiency and continued evolution of Debian's APT tools, some gaps in package management functionality remain. One of the largest ones is that, when a package is removed, any other packages that depend on it are not removed. The result is a growing number of orphans on the system -- that is, packages that serve no purpose for the system as a whole, although in some cases they continue to be useful individually. Similarly, while you can keep track of security announcements for Debian or distributions derived from it, the basic package system has no way of telling you which vulnerabilities might affect your system. To compensate for these lacks, you can turn to a group of housekeeping tools that make maintaining your Debian system easier and more efficient."

to post comments

Housekeeping utilities for Debian packages (Linux.com)

Posted Nov 30, 2006 23:22 UTC (Thu) by josh_stern (guest, #4868) [Link] (3 responses)

The author seems to be using some sort of colloquial meaning of "depend" rather than the technical meaning used in debian (and other) package management. Basic package mgmt. prevents removal of packages when other stuff depends on them but allows packages that no longer support other stuff to remain. From deborphan: "deborphan finds packages installed on your Debian/GNU system that have no other packages depending on them."

Housekeeping utilities for Debian packages (Linux.com)

Posted Dec 1, 2006 0:00 UTC (Fri) by proski (subscriber, #104) [Link] (2 responses)

I think the author tried to use the technical term (as evidenced by his references to recommended and suggested packages), but got it backwards. Look how the story interprets the "prune" command in debfoster:
prune: that is, remove not only the package but all others that depend on it
That's pretty cruel, although useful in some cases. But let's see what the debfoster manual says:
Prune the package. This tells to also delete all packages that are only installed because this package depends on them.
A world of difference.

Housekeeping utilities for Debian packages (Linux.com)

Posted Dec 1, 2006 10:01 UTC (Fri) by hummassa (subscriber, #307) [Link] (1 responses)

> prune: that is, remove not only the package but all others that depend
on it
Yeah, actually, when I read this I thought: "hey, if you remove a package
you will always remove all others that depend on it..." (lest you will be
with a lot of dangling-referencing packages installed)

Housekeeping utilities for Debian packages (Linux.com)

Posted Dec 1, 2006 17:24 UTC (Fri) by proski (subscriber, #104) [Link]

From http://members.axion.net/~bbyfield/:
In the past, Byfield has been a university English instructor, a technical writer, a product manager, a director of marketing and communications, a developmental editor, and a consultant in communications, marketing, and design. When dealing with technological issues, Byfield makes a hands-on comprehension of the technology his first priority.
And yet he cannot grasp the concept of dependency between packages!

aptitude is the awnser

Posted Dec 1, 2006 3:33 UTC (Fri) by miguelzinho (guest, #40535) [Link] (7 responses)

"One of the largest ones is that, when a package is removed, any other packages that depend on it are not removed."

The awnser is `aptitude`. Aptitude is officialy supported and recommended since Sarge release. It is the most complete and competent package manager that man knows, IMHO.

From: http://linux.derkeiler.com/Mailing-Lists/Debian/2004-04/3181.html

"Nine reasons why you should be using aptitude instead of apt-get or dselect."

1. aptitude can look just like apt-get

If you run 'aptitude update' or 'aptitude upgrade' or 'aptitude install', it looks and works just like apt-get, with a few enhancements. So there is no learning curve.

(If you're a dselect user, learning curve is obviously not one of your problems.)

2. aptitude tracks automatically installed packages

Stop worrying about pruning unused libraries and support packages from your system. If you use aptitude to install everything, it will keep track of what packages are pulled in by dependencies alone, and remove those packages when they are no longer needed.

3. aptitude sanely handles recommends

A long-standing failure of apt-get has been its lack of support for the Recommends relationship. Which is a problem because many packages in Debian rely on Recommends to pull in software that the average user generally uses with the package. This is a not uncommon cause of trouble, even though apt-get recently became able to at least mention recommended packages, it's easy to miss its warnings.

Aptitude supports Recommends by default, and can be confgigured to support Suggests too. It even supports installing recommended packages when used in command-line mode.

4. use aptitude as a normal user and avoid hosing your system

Maybe you didn't know that you can run aptitude in gui mode as a regular user. Make any changes you'd like to try out. If you get into a real mess, you can hit 'q' and exit, your changes will not be saved.

(Aptitude also lets you use ctrl-u to undo changes.) Since it's running as a normal user, you cannot hose your system until you tell aptitude to do something, at which point it will prompt you for your root password.

5. aptitude has a powerful UI and searching capabilities

Between aptitude's categorical browser and its great support for mutt-style filtering and searching of packages by name, description, maintainer, dependencies, etc, you should be able to find packages faster than ever before using aptitude.

6. aptitude makes it easy to keep track of obsolete software

If Debian stops distributing a package, apt will leave it on your system indefinitly, with no warnings, and no upgrades. Aptitude lists such packages in its "Obsolete and Locally Created Packages" section, so you can be informed of the problem and do something about it.

7. aptitude has an interface to the Debian task system

Aptitude lets you use Debian's task system as it was designed to be used. You can browse the available tasks, select a task for install, and then dig into it and de-select parts of the task that you don't want. apt-get has no support for tasks, and aptitude is better even than special purpose tools like tasksel.

8. aptitude supports multiple sources

If your sources.list is configured to make multiple versions of a package available, aptitude lets you drill down to see the available versions and pick a non-default version to install. If a package breaks in unstable, just roll it back to the version in testing.

9. aptitude logs its actions

Aptitude logs package it installs, upgrades, and removes to /varlog/aptitude, which can be useful to work out why things started breaking after yesterday's upgrade, or when you removed a partiticlar package.

aptitude is the awnser

Posted Dec 1, 2006 14:24 UTC (Fri) by kl (guest, #36963) [Link]

The awnser is `aptitude`. Aptitude is officialy supported and recommended since Sarge release. It is the most complete and competent package manager that man knows, IMHO.
Aptitute has "only" two problems:

1. Aptitude uses quite a lot of memory (this is problem for some of us). It's also slower than apt-get.

2. Handling automatically installed packages is broken. (Doesn't work from command line.)

What e.g. "aptitude unmarkauto foobar" does?

It should mark foobar as manually installed. Sadly, aptitude tries to remove package.

Hopefully this bug will be fixed some day.

aptitude is the answer

Posted Dec 1, 2006 14:32 UTC (Fri) by debacle (subscriber, #7114) [Link]

dpkg logs its actions as well, so you get the information about package installs, removals etc. whether you are using apt-get, aptitude, dpkg, or whatever. IIRC, this has been introduced just after sarge release.

aptitude is the awnser

Posted Dec 1, 2006 14:42 UTC (Fri) by hein.zelle (guest, #33324) [Link] (4 responses)

I used to agree, but lately i've run into some problems (likely caused by me) that have caused me to consider using apt-get instead of aptitude.

When I install a package using aptitude in ubuntu, it will sometimes suddenly suggest to remove about 40 other packages (that I do want) because apparently one dependency got removed somewhere. ubuntu-desktop and xubuntu-desktop have a tendency to do this (they get removed "accidently" and everything that they depend on as well).

I'm almost sure it's something I did, for example combining apt-get with aptitude, but I have no idea what I'm doing wrong in these cases. It's relatively easy to fix (usually aptitude install removed-package) and quite fast when the package files are still in the cache, but it's a rather big nuisance nevertheless. At work this is not something I enjoy when it happens.

Any ideas on what might cause this behaviour?

Apart from that, some good tips in your response, I always thought of running aptitude as a regular user as being a nuisance, but you have a good point about not messing things up if you quit. I'll be running it that way from now on. Are there any good manuals out there on how aptitude is intended to be used? I still don't know how to have it handle recommends from the commandline, and there's probably more features I should learn about.

aptitude is the awnser

Posted Dec 1, 2006 16:20 UTC (Fri) by jstAusr (guest, #27224) [Link]

The package aptitude-doc-xx ???

aptitude is the awnser

Posted Dec 1, 2006 19:08 UTC (Fri) by vmole (guest, #111) [Link]

Any ideas on what might cause this behaviour?

Yes, it's because you're using unstable and there are often unfulfilled dependencies as package relationships change, yet don't go into the archive in one run. In particular, a new libname.so version goes in, the old one drops out, and every packagbe that depended on the old one become uninstallable. Aptitude wants to upgrade to the newest libname.so, so it wants to remove all the "old" packages. This is reasonable, but annoying.

The good news is that the newer versions of aptitude have a dependency resolution system that let's you try different solutions ("Hold pacakge libfoo") semi-automatically, without actually putting packages on hold. It scores each solution according to how much change it makes to your system, so ususally the low score is what you want. (I'm not describing it well, you sort of have to see it in action.)

aptitude is the awnser

Posted Dec 2, 2006 12:46 UTC (Sat) by MKesper (subscriber, #38539) [Link]

I'm almost sure it's something I did, for example combining apt-get with aptitude, but I have no idea what I'm doing wrong in these cases.

Well you should simply _not_ do that.
I always use aptitude for installing / removing and apt-cache for searching (searches full text; search keywords are associated with AND).

aptitude is the awnser

Posted Dec 2, 2006 16:33 UTC (Sat) by sammythesnake (guest, #17693) [Link]

"it will sometimes suddenly suggest to remove about 40 other packages (that I do want) because apparently one dependency got removed somewhere"

If this is because the package has been marked for auto removal, perhaps you could work around it by installing that package with apt-get, thus avoiding it being marked as auto-installed?

Just a though, I've not hit this behaviour myself...

Cheers & God bless
Sam "SammyTheSnake" Penny


Copyright © 2006, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds