| Notes | Schedules | Venues | Ubuntu Mirror |
Steps taken to build and use our local Ubuntu mirror for Gutsy Gibbon 7.10 Server.
Here are some HowTo pages that I used to build my Gutsy Gibbon (Ubuntu 7.10) mirror on my laptop while located in Santiago, Chile. There are changes to the way things work since these were written, but they contain very useful information.
These steps build a mirror that contains binary packages, no sources, for the main repositories for Ubuntu Server 7.10. As this mirror was built while in Santiago, Chile the local Chilean Ubuntu mirror was used to download packages. You should adjust your /etc/apt/mirror.list file to represent the closest Ubuntu mirror to your current location. Note, you should always verify that Ubuntu archive sites listed in /etc/apt/sources.list are actually local, and not just pointing to the main US mirrors (hint, use dig).
* On another Ubuntu box install the apt-mirror package:
$ sudo apt-get install apt-mirror
* Files that are installed:
- /etc/apt/mirror.list
- /var/spool/apt-mirror/
/var/spool/apt-mirror/mirror/
/var/spool/apt-mirror/skel/
/var/spool/apt-mirror/var/
- /etc/cron.d/apt-mirror
- user and group of apt-mirror are created
* The default /etc/apt/mirror.list file seemed pretty good to me. Here is what the default file looked like:
--------------------------- TOF -------------------------------
############# config ##################
#
# set base_path /var/spool/apt-mirror
#
# if you change the base path you must create the directories below with write privlages
#
# set mirror_path $base_path/mirror
# set skel_path $base_path/skel
# set var_path $base_path/var
# set cleanscript $var_path/clean.sh
# set defaultarch <running host architecture>
set nthreads 20
set tilde 0
#
############# end config ##############
deb http://archive.ubuntu.com/ubuntu gutsy main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu gutsy-updates main restricted universe multiverse
#deb http://archive.ubuntu.com/ubuntu gutsy-backports main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu gutsy-security main restricted universe multiverse
#deb http://archive.ubuntu.com/ubuntu gutsy-proposed main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu gutsy main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu gutsy-updates main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu gutsy-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu gutsy-security main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu gutsy-proposed main restricted universe multiverse
clean http://archive.ubuntu.com/ubuntu
--------------------------- EOF -------------------------------
* Here is what my configured file looks like:
--------------------------- TOF -------------------------------
############# config ##################
#
# set base_path /var/spool/apt-mirror
#
# if you change the base path you must create the directories below with write privlages
#
# set mirror_path $base_path/mirror
# set skel_path $base_path/skel
# set var_path $base_path/var
# set cleanscript $var_path/clean.sh
# set defaultarch <running host architecture>
set nthreads 20
set tilde 0
#
############# end config ##############
deb http://cl.archive.ubuntu.com/ubuntu gutsy main restricted universe multiverse
deb http://cl.archive.ubuntu.com/ubuntu gutsy-updates main restricted universe multiverse
#deb http://archive.ubuntu.com/ubuntu gutsy-backports main restricted universe multiverse
deb http://cl.archive.ubuntu.com/ubuntu gutsy-security main restricted universe multiverse
#deb http://archive.ubuntu.com/ubuntu gutsy-proposed main restricted universe multiverse
##
## Not mirroring sources to start
##
#deb-src http://cl.archive.ubuntu.com/ubuntu gutsy main restricted universe multiverse
#deb-src http://cl.archive.ubuntu.com/ubuntu gutsy-updates main restricted universe multiverse
# Originally commented out
##deb-src http://archive.ubuntu.com/ubuntu gutsy-backports main restricted universe multiverse
#deb-src http://cl.archive.ubuntu.com/ubuntu gutsy-security main restricted universe multiverse
# Originally commented out
##deb-src http://archive.ubuntu.com/ubuntu gutsy-proposed main restricted universe multiverse
clean http://cl.archive.ubuntu.com/ubuntu
--------------------------- EOF -------------------------------
$ sudo apt-mirror /etc/apt/mirror.list
Note that many examples on the web use the old apt-mirror command format of "apt-mirror -c apt-mirror". This will fail for the current (Ubuntu 7.10) version of apt-mirror.
- Decide if you want to update your mirror on a daily basis (0400 hours) using the installed cron
file here /etc/cron.d/apt-mirror. Just uncomment the the last line in the file to make the job
active.
- Create logical links from /var/spool/apt-mirror to your /var/www/share (in my case) directory so
that your web server can act as a package archive. To do this (for example) you might do:
sudo ln -s /var/spool/apt-mirror/mirror/archive.ubuntu.com/ubuntu /var/www/share/ubuntu
- Point your own machine to itself to grab updates locally. Point local machines on your network to
your box to save on external network bandwidth. You can do this several ways:
+ Edit /etc/hosts to point archive.ubuntu.com to your localhost (won't work in all cases).
+ If you have a local nameserver, then spook *.ubuntu.archive.com to your local server.
+ Edit /etc/apt/source.list and point apt to your local machine instead of the Ubuntu
archives you are currently using.
Post Installation Note
If you edit the file /etc/apt/mirror.list and point to a different set of archives (say de.archive.ubuntu.com instead of cl.archive.ubuntu.com), then apt-mirror will attempt to download all of the archives files again. Thus, you cannot easily keep your mirror up-to-date if you move from region-to-region.
For instance if you drag your mirror along on a laptop, or an external drive to workshops you'll probably want to update it before leaving, then not update it from the remote site.
I imagine you might be able to do some renaming of directories or updating of files in /var/spool/apt-mirror to resolve this issue.