Network Management

Ubuntu Mirror

| 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 -------------------------------

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.