On Tuesday, January 08, 2013 19:45:17, James E. LaBarre wrote: > On 01/08/2013 06:43 PM, Chris Knadle wrote: > > Usually I use aptitude for both upgrades and package update/upgrades,... > > Never cared for Aptitude, mainly because if it's tendency to > automatically remove all packages the system thinks are no longer in > use, without prompting you if you in fact *want* them removed. A very > dangerous default (can it even be changed?) when you've removed a single > package from a metapackage, and because the metapackage got removed as > well, the system might think the rest of the packages in the metapackage > are orphaned.
I understand your trepidation, because aptitude can be user-hostile at first, and it is easy to make some seemingly dangerous choices. It's an expert tool -- and like all expert tools it is capable of doing horrible things. In terms of the "remove lots of packages" problem, I suspect that the '--safe-resolver' option might be what you want. See the man page. I think that you can set Aptitude::Always-Use-Safe-Resolver in either /etc/apt/apt.conf or in ~/.aptitude/config to make this the default behavior. Aptitude doesn't "automatically" *do* anything -- though however in terms of /selection/ it will respect your choice, and if you're removing something that's a dependency on other packages, it will set those other packages as "broken" and requiring an action to be taken on the broken packages. The usual way of dealing with that is to press "e" to enter the interactive resolver screen, but if you don't do this then when you press "g" aptitude will make a default choice that will resolve the conflict -- and that's where it's common for the problem you describe to happen. However it still gives you a review screen of what it's about to do, and does *not* actually *do* any action until you press "g" again, so you can still press "q" at that point to go back and change the selections. And at this point you also always have the option of pressing Ctrl-u to "undo", or pressing Ctrl-c to break out of aptitude and forget the session. After you've pressed "g" for "go" *twice*, the selections you made are saved even if you break out of aptitude with Ctrl-C. At that point if you've screwed up the choices, you can use ":" to undo choices on individual packages or /sections/ of pacakges, including all of the chosen pacakges to be upgraded. This ":" option isn't obvious and I don't see it talked about much. Another option in Aptitude is to mark packages as /manually/ installed with "m", or "M" for automatically installed for dependency reasons. Marking packages via "m" keeps them from being uninstalled if they're orphaned. If at some point you give aptitude another try, make sure to press "?" to see the help screen, which gives a brief blurb for all of these choices. My latest favorite feature of aptitue has to do with the search "/" feature; I recently had to back out of multi-arch due to some architecture-specific pacakge conflicts -- I wanted to remove all pacakges of the i386 architecture so I could perform a 'dpkg --remove-architecture i386', which of course simply outputs an error if there are packages loaded with the architecture that is about to be removed. Looking through the aptitude docs, I found the search: "?architecture(i386)" -- and then all I had to do was purge "_" all of the packages in that list. There are all kinds of interesting searches you can do, like finding all packages that have been removed but still have the configuration left behind (i.e. not purged). There are several features that aptitude has that I haven't found other equivalents for and which I don't know how to do via the apt-get command line. All that really matters is if you're happy with the tool that you're using, though -- thankfully there's no /need/ for using aptitude if you don't like it. :-P -- Chris -- Chris Knadle [email protected] _______________________________________________ Mid-Hudson Valley Linux Users Group http://mhvlug.org http://mhvlug.org/cgi-bin/mailman/listinfo/mhvlug Upcoming Meetings (6pm - 8pm) Vassar College Jan 9 - High Performance Computing at a Small Scale Feb 6 - Raspberry Pi Mar 6 - 10th Anniversary Meeting - Linux where you least expect it
