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:
sudo aptitude
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
aptitude update
aptitude safe-upgrade

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. :)

About these ads

~ by Preston on October 29, 2007.

One Response to “I’ve got a new “Aptitude””

  1. This is really attention-grabbing, You’re an excessively professional blogger. I have joined your feed and sit up for searching for more of your great post. Also, I have shared your web site in my social networks

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.

%d bloggers like this: