I don't understand the new aptitude 

Newsgroups: gmane.linux.debian.user
Date: Tue, 22 May 2007 08:31:29 -0400

I can't get my head around the (as of etch) newfangled aptitude dependency handling procedure. As an example, I'm trying to install texlive. As soon as I hit '+', I see this cryptic message in the bottom line:

[1(1)/…] Suggest 2 installs, 4 keeps w: examine !: apply …

(…and I just noticed I had to copy that by hand because aptitude —and only aptitude!— seems to disallow copying text from the xterm it's running in! What kind of sadism is that?)

Anyway, when I type '!', thinking that aptitude will now do what it suggests, namely install stuff, all the to-be-installed things are deselected and nothing happens.

So maybe 'e'xamining things will tell me stuff. When I do that, I see lists of packages that could be "kept" at their current versions (which doesn't make sense because they are flagged "UNINST". I also see lists of packages to be installed. Anyway, as soon as I hit '!' everything goes away again. I also can scroll through many alternatives using '.' and ',' but I don't really understand what this is all about.

The sarge aptitude used to be less unwieldy.

So how does this work?

I don't understand the new aptitude 

> So how does this work?

I can tell you how I use it:

'e' gets you the list of suggested resolutions, as you've discovered. If one of them looks reasonable, '!' will choose that one. Sometimes that has the effect of just cancelling what you were going to do, sometimes it removes something, sometimes it installs something.

If none of the options looks right, hit 'q' (which, I believe, is not listed as an option). This will return you to the previous view, where you can fix things by hand. I've been doing this daily in sid while I wait for python-matplotlib and python-scipy to be updated for the latest python-numpy. The only way to get control back once aptitude has entered its problem resolution mode is to hit 'e' and then 'q', at least that I've found. I then go and hold the problem packages with ':'.

As an aside, another way you can install texlive is to use aptitude as a command-line tool:

aptitude install texlive

That might present you with an easier-to-manage dependency resolution.

Michael A. Marsh

I don't understand the new aptitude 

> (...and I just noticed I had to copy that by hand because aptitude
> --and only aptitude!-- seems to disallow copying text from the xterm
> it's running in! What kind of sadism is that?)

This is because aptitude asks xterm to send it mouse events, as do other programs (links and w3m come to mind). Since aptitude is getting the mouse events, xterm can't use them to copy & paste.

You can still select text while aptitude is running by holding down shift while you click.

> ... I also can scroll through many alternatives
> using '.' and ',' but I don't really understand what this is all about.

That's interesting. Could you say which packages are broken and which ones aptitude says it wants to install / keep? This might be a bug. It would also be interesting to see what you get when you press "o" to get a breakdown of why the resolver did what it did.

The resolver information screen lists as "kept" packages packages whose upgrade or installation is going to be cancelled. It might be that aptitude decided to cancel installing texlive for some reason, which would cancel installing all the stuff it depends on (unfortunately, the removal of unused packages doesn't integrate with the resolver). My guess is that aptitude can't find any resolution that includes texlive; you could verify this by pressing "r" while the "keep texlive at its current version" option is selected, then seeing what the next new solution is.

My usual procedure using the resolver is to hit "e" to pop into the resolution screen and examine the decision aptitude made. You can select the individual actions in the list it presents to see why it made each decision (in the lower pane of the display).

I tag the decisions it made that I don't like by pressing "r", then ask it for the next solution; lather, rinse, repeat until I'm satisfied. If I'm not satisfied after looking at a few solutions, I might resolve things by hand, or just take the first solution (which usually errs on the side of being too conservative). You apply the solution by pressing "!".

In some cases "a" can also be useful; it tells aptitude to take an action whenever possible. This is partiularly useful (IMO) combined with tabbing into the list of alternative choices that shows up in the lower pane of the solution view.

Daniel Burrows @debian.org