Open main menu

Linux and Unix Users Group at Virginia Teck Wiki β

Ubuntu

Revision as of 21:04, 17 November 2009 by imported>Cov

Using Local Mirrors

You will need to alter your /etc/apt/sources.list file. First of all, make a backup of your original. Open a terminal emulator (Applications → Accessories → Terminal) and enter the command:

sudo cp /etc/apt/sources.list /etc/apt/sources.list.original

Next, copy the commands below into a shell script. You can use a text editor like gedit; Applications → Accessories → Text Editor. Select the mirror you wish to remove by uncommenting (removing the beginning # character from) one of the two lines with MIRROR=. Save it in your home directory as vtmirror.sh:

#!/bin/sh
## Uncomment one of the two MIRROR lines below to choose your mirror
##
## VT Campus Computing mirror
#MIRROR="mirror.cc.vt.edu/pub/ubuntu"
## VBI Mirror (which also hosts PowerPC and SPARC repositories)
#MIRROR="mirrors.vbi.vt.edu/mirrors/linux/ubuntu"

sed "s,\(us\.\)\?archive.ubuntu.com/ubuntu,$MIRROR," /etc/apt/sources.list.original |\
sed s,security.ubuntu.com/ubuntu,$MIRROR, > \
/etc/apt/sources.list.new
mv /etc/apt/sources.list.new /etc/apt/sources.list

IMPORTANT: make sure that you have uncommented one of the MIRROR= lines. Next, in your terminal window, change the permissions on this file to make it executable:

chmod u+x vtmirror.sh

Finally, run the script from the terminal with

sudo ./vtmirror.sh

Next, update your package information. You can do this in the terminal with

sudo apt-get update

You can also do this with the Update Manager in System → Administration → Update Manager. You will now be downloading all standard Ubuntu packages from your local VT mirror.