apt-mirror creates a local database with packages from Ubuntu's repositories. Below is the configuration file we use - it must be placed in /etc/apt/mirror.list
. Note, these repositories are ~35GB ( October 2010 ). An alternative to downloading them from the internet is to copy them from an external harddisk (in that case, apt-mirror is not needed?). The standard location for all the repositories is /var/spool/apt-mirror
.
Notice that we are very careful to include debian-installer from various locations, since including for instance the universe repository on top of the main repository would alter package layouts, and the main debian-installer would therefore have to be a different version, ie. the one in the universe repository.
In this example we sync from an Ubuntu archive, but we could also be syncing from another local machine. In that case, change the URLs appropriately.
The following configuration was applied to successfully setup the Ubuntu 12.04 mirror:
############# config ##################
#
# set base_path /var/spool/apt-mirror
#
# 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 postmirror_script $var_path/postmirror.sh
# set run_postmirror 0
set nthreads 20
set _tilde 0
#
############# end config ##############
deb http://dk.archive.ubuntu.com/ubuntu precise main restricted universe multiverse main/debian-installer restricted/debian-installer universe/debian-installer
deb http://dk.archive.ubuntu.com/ubuntu precise-security main restricted universe multiverse main/debian-installer universe/debian-installer
deb http://dk.archive.ubuntu.com/ubuntu precise-updates main restricted universe multiverse main/debian-installer universe/debian-installer
clean http://dk.archive.ubuntu.com/ubuntu
############# config ##################
#
# set base_path /var/spool/apt-mirror
#
# 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 postmirror_script $var_path/postmirror.sh
# set run_postmirror 0
set nthreads 20
set _tilde 0
#
############# end config ##############
deb http://dk.archive.ubuntu.com/ubuntu lucid main restricted universe multiverse main/debian-installer restricted/debian-installer universe/debian-installer
deb http://dk.archive.ubuntu.com/ubuntu lucid-security main restricted universe multiverse main/debian-installer universe/debian-installer
deb http://dk.archive.ubuntu.com/ubuntu lucid-updates main restricted universe multiverse main/debian-installer universe/debian-installer
clean http://dk.archive.ubuntu.com/ubuntu
An Ubuntu mirror is located at Copenhagen Institute of Math (HC Ørsteds Instituttet). Go there, and you will have optimal download speed. I downloaded all of Ubuntu 10.10 repos in less than 1 hour at 11.5 MiB/sec. //Benjamin
38.3 GiB will be downloaded into archive.
Downloading 36095 archive files using 40 threads...
Begin time: Mon Sep 19 17:57:33 2011
[40]... [39]... [38]... [37]... [36]... [35]... [34]... [33]... [32]... [31]... [30]... [29]... [28]... [27]... [26]... [25]... [24]... [23]... [22]... [21]... [20]... [19]... [18]... [17]... [16]... [15]... [14]... [13]... [12]... [11]... [10]... [9]... [8]... [7]... [6]... [5]... [4]... [3]... [2]... [1]... [0]...
End time: Mon Sep 19 18:59:39 2011
New software is installed from a central library by a program called "apt-get". By default, "apt-get" will connect to a central library over the Internet, but we need to reconfigure it to use the local repository. Apt-get is configured to look for software packages by reading a file called "sources.list". This file is located in /etc/apt.
The following file will tell apt-get to install new software (and updates to existing software) from the local hard-disk.
deb file:///var/spool/apt-mirror/mirror/dk.archive.ubuntu.com/ubuntu lucid main restricted universe multiverse
deb file:///var/spool/apt-mirror/mirror/dk.archive.ubuntu.com/ubuntu lucid-security main restricted universe multiverse
deb file:///var/spool/apt-mirror/mirror/dk.archive.ubuntu.com/ubuntu lucid-updates main restricted universe multiverse
deb file:///var/spool/apt-mirror/mirror/dk.archive.ubuntu.com/ubuntu maverick main restricted universe multiverse
deb file:///var/spool/apt-mirror/mirror/dk.archive.ubuntu.com/ubuntu maverick-security main restricted universe multiverse
deb file:///var/spool/apt-mirror/mirror/dk.archive.ubuntu.com/ubuntu maverick-updates main restricted universe multiverse
deb file:///var/spool/apt-mirror/mirror/dk.archive.ubuntu.com/ubuntu maverick main restricted universe multiverse
deb file:///var/spool/apt-mirror/mirror/dk.archive.ubuntu.com/ubuntu maverick-security main restricted universe multiverse
deb file:///var/spool/apt-mirror/mirror/dk.archive.ubuntu.com/ubuntu maverick-updates main restricted universe multiverse