Wednesday, 20 October 2010

Getting apt-get working in Debian

If you skipped the network configuration during the installation process for Debian, apt-get will not work off the bat. In order to get this going, you need to add the right sources to /etc/apt/sources.list. I found some great instructions at this site. First, get rid of the default CD sources and replace them with the following:

deb http://http.us.debian.org/debian stable main contrib non-free
deb http://non-us.debian.org/debian-non-US stable/non-US main contrib non-free
deb http://security.debian.org stable/updates main contrib non-free

Next, install the netselect-apt utility. This nifty thing will help you find the fastest server based on your location. This is done in the usual manner:

$ sudo apt-get install netselect-apt

Once it's installed, run it (as root):

$ sudo netselect-apt

It will ping a bunch of servers and create a sources.list file in the current location which points to the fastest server. All you need to do now is to move/copy this file to the correct location:

$ sudo mv /etc/apt/sources.list /etc/apt/sources.list.old
$ sudo cp sources.list /etc/apt/

And you're set.

No comments:

Post a Comment