Skip to content


How to setup your own ubuntu mirror using apt-mirror

apt-get install apt-mirror apache2

apt-mirror’s configuration file is /etc/apt/mirror.list. There should already be a default configuration in it

Make changes you would like to have.

If you used the defaults you should be all set. If you moved where you want the files stored make sure you create the correct file structure and it has the correct permissions.

When you are ready and have the time just run the following command.

su – apt-mirror -c apt-mirror

Depending on what changes you made to the mirror.list this may take a very long time. I let it go over night the first time I ran it.

Once it is all finished, if you want to point to this mirror from other boxes on your network then you will have to publish the new files via apache2. Example of mythbuntu truck repo below.

ln -s /jn/apt-mirror/mirror/weeklybuilds.mythbuntu.org/mythbuntu-trunk/ /var/www/mythbuntu-trunk

This line setups a symbolic link in apache2 to the new area created with apt-mirror.

Now just go to the source.list file on all of your boxes and point them to the new mirror instead of the official mirror it currently points to.

My current mirror.list:

############# config ##################
#
# set base_path    /var/spool/apt-mirror
set base_path    /jn/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  x86
set nthreads     20
set tilde 0
#
############# end config ##############

#deb http://us.archive.ubuntu.com/ubuntu gutsy main restricted universe multiverse
deb http://mirror.cs.umn.edu/ubuntu gutsy main restricted universe multiverse
deb-amd64 http://mirror.cs.umn.edu/ubuntu gutsy main restricted universe multiverse

#deb http://archive.ubuntu.com/ubuntu gutsy-updates main restricted universe multiverse
deb http://mirror.cs.umn.edu/ubuntu gutsy-updates main restricted universe multiverse
deb-amd64 http://mirror.cs.umn.edu/ubuntu gutsy-updates main restricted universe multiverse

#deb http://archive.ubuntu.com/ubuntu gutsy-backports main restricted universe multiverse
deb http://mirror.cs.umn.edu/ubuntu gutsy-backports main restricted universe multiverse
deb-amd64 http://mirror.cs.umn.edu/ubuntu gutsy-backports main restricted universe multiverse

#deb http://archive.ubuntu.com/ubuntu gutsy-security main restricted universe multiverse
deb http://mirror.cs.umn.edu/ubuntu gutsy-security main restricted universe multiverse
deb-amd64 http://mirror.cs.umn.edu/ubuntu gutsy-security main restricted universe multiverse

#deb http://archive.ubuntu.com/ubuntu gutsy-proposed main restricted universe multiverse
deb http://mirror.cs.umn.edu/ubuntu gutsy-proposed main restricted universe multiverse
deb-amd64 http://mirror.cs.umn.edu/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

#deb http://weeklybuilds.mythbuntu.org/mythbuntu-trunk/ubuntu gutsy multiverse universe restricted main
#deb-amd64 http://weeklybuilds.mythbuntu.org/mythbuntu-trunk/ubuntu gutsy multiverse universe restricted main

#deb http://mirror.cs.umn.edu/ubuntu hardy main restricted universe multiverse
#deb-amd64 http://mirror.cs.umn.edu/ubuntu hardy main restricted universe multiverse

clean http://mirror.cs.umn.edu/ubuntu
#clean http://weeklybuilds.mythbuntu.org/mythbuntu-trunk/ubuntu

Posted in Linux.


0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

You must be logged in to post a comment.