I’ve got a new “Aptitude”
Most people know that I have been using Debian for several years now and in that time I have been happily “apt-getting” my software needs. To be quite honest, I couldn’t imagine using any other means of searching, installing, or removing packages from my system.
My typical routine was as follows:
1) update my database
2) see what changes were going to happen when I update my system using the –dry-run option
3) update my system
Unfortunately my old way of doing things was…flawed. See, the problem comes into apt’s inability to keep up with dependencies effectively. Couple this with apt not completely removing unnecessary files and you can see where things would start to compound.
Yes, I have used apt-get autoremove to help clean up my system and it seems much easier than using the deb-orphan, apt-rdepends, and debfoster commands (although to be honest I haven’t run a head-to-head comparison to see what differs). This program aside, the issue of removing a dependent file and accidentally breaking a program (or even the entire system) is still a very real threat. Debian is one of the best distros available and has generally staked it reputation as being very stable with an awesome package management system, so why is it now becoming so complex?
I needed to find a better way so into the newsgroups I dove. More and more the answer seemed to come back with “use Aptitude”. Unfortunately I had tried Aptitude a long while back and when it wanted to remove my entire desktop with its’ related packages I pretty much freaked. It seemed that apt-get and aptitude didn’t share the same information even though both were basically front-ends to dpkg. This was disconcerting, but possibly was my own fault for running a mixed sources system… though many others reported the same findings.
I needed to figure a way to transition to Aptitude (while keeping my system mixed) without a lot of headache. I found that I could “hold” packages to keep them from being upgraded (like apt-pinning, only easier) until their dependencies were available. My outlook brightened until I read that the easiest way to do this was probably through the curses based interface for Aptitude. I soured a bit. Learning how to get around in Aptitude seemed a lot more hassle than I wanted to deal with, especially since the command line had seemed to work well for me thus far.
A good bit later after some more research I decided that it was time for me to give it a go. I opened a terminal and, since I was a user, started Aptitude by issuing the command
sudo aptitude (alternatively I found that I could have become root from the “Actions” menu). Immediately I was greeted with a nice curses interface that was still a bit unsettling for me.
I used “Ctrl+T” to get to the menu at the top of the screen. From there I arrowed over to “Options” and told Aptitude not to include recommends. Then I went down the list of packages that Aptitude wanted to remove or upgrade and set packages I wanted held by using the “=” key. After a good while, I pressed “g” to see what Aptitude wanted to do. Seeing a few things that needed my attention I pressed the “q” key to quit back to the main menu and made a couple more adjustments. Again I pressed the “g” key and after carefully checking things decided that I was ready so I sat back and watched Aptitude do its’ magic. Afterward, I fired up several programs and then restarted my system to check the most common programs I used and was surprised at how well the transition went.
After you have converted to using Aptitude you can still use terminal commands as before, albeit with a slight change. For the most part just substitute “aptitude” instead of “apt-get” and run the commands. One small caveat being that aptitude likes “safe-upgrade” instead of just “upgrade”.
The biggest difference I have found is that “aptitude search” doesn’t work as expected. For aptitude to use descriptions you have to add “~d” in front of the search term like:
aptitude search ~dgame
This seems a little odd for me since I would have thought it would be something like a “-d” option or even have a space between the “~d” and search term.
Currently I open a terminal, type:
to start the curses interface and wait a minute for aptitude to update. While in the curses interface I can also search for packages with “/” and if I find something I would like I add it with the “+” key. Once I have added or removed the programs I want I press “g”, view the results and press “g” again to commit. After that I press “q” to exit after the system has upgraded.
Outside the curses interface it is just as simple as apt-get:
*remember to preface these with “sudo” if you are running as user
I am very pleased with the results and encourage everyone to do the same, but your mileage might vary and remember that if you break it you can keep all the pieces. :)