Get more from APT

Every Debian user should have a good relationship with APT. We use it for all sorts of stuff and it has made our daily computing life so much easier. apt-get is great but there are more apt utilities out there that can make things even better. I introduce to you some great additions to APT.

apt-build

apt-build allows you to optimize your system for your architecture. You can use different levels of optimization and have a good deal of control over what is going on. apt-build is available in the repositories. Let’s install apt-build and give it a try.

apt-get install apt-build

Once apt-build has been downloaded and installed you will be asked how much optimization you want down, low, medium, or high. The higher you go the more work it has to do and the more time is used. After that you will be asked what kind of processor you have. if you need to reconfigure apt-build later on you can use dpkg.

dpkg-reconfigure apt-build

Once you have apt-build all set up you can use it a lot like apt-get. update, upgrade, program installation, and even an entire system recompilation.

commands:

  • apt-build update
  • apt-build upgrade
  • apt-build install
  • apt-build world (system recompile. Only do this if you know what you’re doing!)

There are some pretty cool features that come along with apt-build too.

  • –noupdate – for when you don’t want to update your repos (good for old boxes)
  • –yes – (my favorite! this just answers yes to all those pesky questions during installs/builds)
  • –force-yes – (approves unauthorized packages. apt-build won’t install unauthorized packages)
  • --reinstall – self explanatory
  • –rebuild – builds package from the start

apt-build can do a lot and I suggest reading the man or googling for more info.

apt-rdepends

apt-rdepends creates a recurrsive list of program dependencies. It is a quick and easy way to figure out what the dependencies are. Installation is quick and easy using apt-get

apt-get install apt-rdepends

To use apt-rdepends

apt-rdepends packagename

apt-rdepends is pretty straight forward. Take a look through the man page to find out more info.

netselect-apt

(quoted from prior article)

How to find the fastest apt repository mirrors with netselect-apt
A few months ago I moved to an other part of the country. Shortly after getting my office set up I realized that my download speeds from the mirrors I had been using previously were incredibly slow. To fix this I did what any logical person would do and I found the closest mirror to me and set that up in my sources.list. After a few days I realized that this wasn’t any faster, in fact it may be slower than it was before. Along comes netselect-apt to the rescue. Using netselect-apt gives you a simple way to check for the fastest mirror available to you at the time and then it even writes a sources.list and puts it in the directory you’re working from. Simply save it to /etc/apt/souces.list, apt-get update and you’re on your way.

Getting started with netselect-apt

First you will need to download and install netselect-apt from apt.

$ apt-get install netselect-apt

Depending on which version of Debian you use then the follow commands will change.

$ netselect-apt etch

Finds the best mirror and write out a sources.list for the main category.

$ netselect -n etch Include the non-free repository in your new sources.list

$ netselect -f etch Includes only ftp servers in the sources.list

If you don’t use etch then the other options are stable, testing, unstable, experimental, woody, sarge, lenny and sid. If you don’t add anything the default will be for stable.

This process may take a while as it will try to get a file from each mirror available to you and rate the speed of the download. Once it has finished working it will write a sources.list to the folder you were in when you ran the program. Either save this as /etc/apt/sources.list and apt-get update or just copy and paste some stuff out of there and save it. I personally just take the info for the mirrors as I have many other repositories in my sources.list that I don’t want changed.

* I have been told that netselect-apt does not work for Ubuntu, if you know this to not be the case please let me know.

Articles That May Be Related

Tags: , ,

This entry was posted on Monday, September 15th, 2008 at 7:00 AM and is filed under Debian, Tips and tricks. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply