Creating an Ubuntu repository mirror with apt-mirror

apt-mirror is a handy tool for creating a replica (or ‘mirror’ if you will) of a Debian archive. This can be useful in a number of circumstances if you want to maintain your own archive. Having your own up to date archive means you have fast access to every package in the distro very quickly.

Maybe you need it for installing a Debian-based distro onto lots of machines on a LAN. For example a system builder who installs Linux on many new computers and wants to improve the speed at which the systems are updated after a clean install. There are of course other tools that can achieve this including apt-catcher, apt-proxy and squid. These are in fact arguably better than the apt-mirror approach. But this is more fun :)

There are other uses for this, and I’m sure I’ll think of them one day.

apt-mirror can be used on any Debian-based repository. So it will work equally well with genuine Debian, Ubuntu or indeed any other .deb based system. Here is the way I setup a local hard disk.

Firstly, prepare some space

Lots of it! The Ubuntu 6.10 (Edgy Eft) repository including main, universe and multiverse currently takes around 30GiB of disk space. Disk space is relatively cheap though, so having a local archive isn’t a big deal space-wise. Bandwidth is a separate consideration though. 30GiB is quite a fair amount of data to pull down over the internet.

I used a 250GiB external USB hard drive. This has the advantage that I can physically attach it to a machine that has no net connection, chuck in an Ubuntu 6.10 (Edgy Eft) CD (or even upgrade from a 6.06 [Dapper] one) and install/upgrade a machine there and then. See – told you there was another use for this!

This is also especially handy if someone has a wierd ethernet card or modem that’s only supported in a very new kernel, or requires something from universe or multiverse to get online. Can’t think of any specific examples of that, but hey, I’m coming up with excuses^Wreasons to do this whole apt-mirror thing all the time.

I have a completely empty USB disk plugged in, lets see how much space there is available.. Ooh lots.

alan@multivac:~$ df -h
Filesystem            Size Used Avail Use% Mounted on
/dev/evms/hda1        5.3G  4.1G  975M  81% /
varrun                244M  112K  244M   1% /var/run
varlock               244M  4.0K  244M   1% /var/lock
procbususb             10M  108K  9.9M   2% /proc/bus/usb
udev                   10M  108K  9.9M   2% /dev
devshm                244M     0  244M   0% /dev/shm
/dev/sda1             233G    4M  229G   0% /media/usbdisk

Make the necessary directories

My USB hard disk gets mounted in the usual place (/media/usbdisk) when I plug it in and turn it on. So I just need to make a directory on that disk and a few subdirectories and we’re done with this step.

alan@multivac:~$ mkdir /media/usbdisk/repo
alan@multivac:~$ mkdir /media/usbdisk/repo/mirror
alan@multivac:~$ mkdir /media/usbdisk/repo/skel
alan@multivac:~$ mkdir /media/usbdisk/repo/var

Install apt-mirror

apt-mirror is in the standard repositories. You can install using your favourite tool like synaptic or aptitude, call me old fashioned, I like apt-get though.

alan@multivac:~$ sudo apt-get install apt-mirror

Edit config

The default settings might work for you okay, but I decided to make some changes.

alan@multivac:~$ sudo gedit /etc/apt/mirror.list

Here’s the default config file:-

############# 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  
set nthreads     20
set tilde 0
#
############# end config ##############
# standard edgy repos
deb http://archive.ubuntu.com/ubuntu edgy main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu edgy-updates main restricted universe multiverse
#deb http://archive.ubuntu.com/ubuntu edgy-backports main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu edgy-security main restricted universe multiverse
#deb http://archive.ubuntu.com/ubuntu edgy-proposed main restricted universe multiverse

deb-src http://archive.ubuntu.com/ubuntu edgy main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu edgy-updates main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu edgy-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu edgy-security main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu edgy-proposed main restricted universe multiverse

clean http://archive.ubuntu.com/ubuntu

Here’s mine. I changed the location where I wanted the repository stored, used the nearest mirror, changed the number of threads and a few extra repositories that I wanted to mirror.

############# config ##################
#
# set base_path    /var/spool/apt-mirror
set base_path /media/usbdisk/repo
#
# 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  
set nthreads     2
set tilde 0
#
############# end config ##############
# standard edgy repos
deb http://gb.archive.ubuntu.com/ubuntu edgy main restricted universe multiverse
deb http://gb.archive.ubuntu.com/ubuntu edgy-updates main restricted universe multiverse
#deb http://gb.archive.ubuntu.com/ubuntu edgy-backports main restricted universe multiverse
deb http://gb.archive.ubuntu.com/ubuntu edgy-security main restricted universe multiverse
#deb http://gb.archive.ubuntu.com/ubuntu edgy-proposed main restricted universe multiverse

deb-src http://gb.archive.ubuntu.com/ubuntu edgy main restricted universe multiverse
deb-src http://gb.archive.ubuntu.com/ubuntu edgy-updates main restricted universe multiverse
#deb-src http://gb.archive.ubuntu.com/ubuntu edgy-backports main restricted universe multiverse
deb-src http://gb.archive.ubuntu.com/ubuntu edgy-security main restricted universe multiverse
#deb-src http://gb.archive.ubuntu.com/ubuntu edgy-proposed main restricted universe multiverse

clean http://gb.archive.ubuntu.com/ubuntu

# Canonical commercial stuff
deb http://archive.canonical.com/ubuntu edgy-commercial main
clean  http://archive.canonical.com/ubuntu 

# Beryl - Unnecessary 3D groovyness :)
# http://ubuntuforums.org/showthread.php?t=263851
deb http://ubuntu.compiz.net/ edgy main-edgy
clean http://ubuntu.compiz.net/

# Skype - Semi-evil and badly-supported-on-linux VOIP solution
# https://help.ubuntu.com/community/Skype
deb http://download.skype.com/linux/repos/debian/ stable non-free
clean http://download.skype.com/linux/repos/debian/

# Codecs - Stuff to allow you to play all that proprietary encoded stuff
# https://help.ubuntu.com/community/RestrictedFormats
deb http://packages.freecontrib.org/plf edgy-plf free non-free
deb-src http://packages.freecontrib.org/plf edgy-plf free non-free
clean http://packages.freecontrib.org/plf

# Automatix - That thing newbies like
# http://www.getautomatix.com/
deb http://www.getautomatix.com/apt edgy main
clean http://www.getautomatix.com/apt

Set aside some time to start the mirroring. It will take “time”. How long? Well, divide ~30GiB by your internet connection speed :)

The first time I ran apt-mirror it scanned the online archives and wanted to download around 30GiB of packages. Worth noting that I didn’t leave it running but killed it when I wanted to get some bandwidth back and restarted it later. It doesn’t start all over again but continues, and you can see this because the total download size goes down with each execution until you have the full archive. If you have a particularly slow connection, or you stop it quite a lot then you’ll likely never finish, at least not whilst edgy is in development!

Once the distro goes stable you can be sure the number of changes will go down. At the time of writing there’s hundreds of MBs changes per day, so now may not be the best time to do this :) The good news is that Edgy is released this week – Yay!

Here’s one of the instances of me running it. Note this isn’t the first time I ran it.

alan@multivac:~$ sudo apt-mirror
Downloading 88 index files using 1 threads...
Begin time: Tue Oct 24 06:41:14 2006
[1]... [0]...
End time: Tue Oct 24 06:41:18 2006

Proceed indexes: [SSSSPPPPPPPP]

4.8 MiB will be downloaded into archive.
Downloading 1 archive files using 1 threads...
Begin time: Tue Oct 24 06:41:36 2006
[1]... [0]...
End time: Tue Oct 24 06:41:37 2006

192.8 MiB in 215 files and 29 directories can be freed.
Run /media/usbdisk/repo/var/clean.sh for this purpose.

Note the handy-dandy script that gets created at the end to clear out the old files you have in your local repository. So we kick that off and here’s what happens next:-

alan@multivac:~$ sudo sh /media/usbdisk/repo/var/clean.sh
Removing 215 unnecessary files [202129408 bytes]...
[0%]......................done.

Removing 29 unnecessary directories...
[0%].............................done.

That was painless!

Using the archive

Ok, so what can we do with this archive. Install software from it! Here’s an example of installing software from the local archive connected to the USB port.

Backup current sources.list

alan@multivac:~$ sudo cp /etc/apt/sources.list /etc/apt/sources.backup

Edit the sources.list

alan@multivac:~$ sudo gedit /etc/apt/sources.list

Here’s the sources.list that goes with the apt-mirror config I used above.

# standard edgy repos
deb file:/media/usbdisk/repo/mirror/gb.archive.ubuntu.com/ubuntu edgy main restricted universe multiverse
deb-src file:/media/usbdisk/repo/mirror/gb.archive.ubuntu.com/ubuntu edgy main restricted universe multiverse
deb file:/media/usbdisk/repo/mirror/gb.archive.ubuntu.com/ubuntu edgy-security main restricted universe multiverse
deb-src file:/media/usbdisk/repo/mirror/gb.archive.ubuntu.com/ubuntu edgy-security main restricted universe multiverse
deb file:/media/usbdisk/repo/mirror/gb.archive.ubuntu.com/ubuntu edgy-updates main restricted universe multiverse
deb-src file:/media/usbdisk/repo/mirror/gb.archive.ubuntu.com/ubuntu edgy-updates main restricted universe multiverse

# Canonical commercial stuff
deb file:/media/usbdisk/repo/mirror/archive.canonical.com/ubuntu edgy-commercial main

# Beryl - Unnecessary 3D groovyness :)
# http://ubuntuforums.org/showthread.php?t=263851
deb file:/media/usbdisk/repo/mirror/ubuntu.compiz.net/ edgy main-edgy

# Codecs - Stuff to allow you to play all that proprietary encoded stuff
# https://help.ubuntu.com/community/RestrictedFormats
deb file:/media/usbdisk/repo/mirror/packages.freecontrib.org/plf edgy-plf free non-free
deb-src file:/media/usbdisk/repo/mirror/packages.freecontrib.org/plf edgy-plf free non-free

# Skype - Semi-evil and badly-supported-on-linux VOIP solution
# https://help.ubuntu.com/community/Skype
deb file:/media/usbdisk/repo/mirror/download.skype.com/linux/repos/debian/ stable non-free

# Automatix - That thing newbies like
# http://www.getautomatix.com/
deb file:/media/usbdisk/repo/mirror/www.getautomatix.com/apt edgy main

Update

Now we update my local machine to let it know what’s in the repository.

alan@multivac:~$ sudo apt-get update
Ign file: edgy/main Translation-en_GB
Ign file: edgy/restricted Translation-en_GB
Ign file: edgy/universe Translation-en_GB
Ign file: edgy/multiverse Translation-en_GB
Ign file: edgy-security/main Translation-en_GB
Ign file: edgy-security/restricted Translation-en_GB
Ign file: edgy-security/universe Translation-en_GB
Ign file: edgy-security/multiverse Translation-en_GB
Ign file: edgy-updates/main Translation-en_GB
Ign file: edgy-updates/restricted Translation-en_GB
Ign file: edgy-updates/universe Translation-en_GB
Ign file: edgy-updates/multiverse Translation-en_GB
Ign file: edgy-commercial/main Translation-en_GB
Ign file: edgy-plf/free Translation-en_GB
Ign file: edgy-plf/non-free Translation-en_GB
Ign file: edgy/main-edgy Translation-en_GB
Ign file: stable Release.gpg
Ign file: stable/non-free Translation-en_GB
Ign file: edgy/main Translation-en_GB
Ign file: stable Release
Ign file: stable/non-free Packages
Get: 1 file: edgy Release.gpg [191B]
Get: 2 file: edgy-security Release.gpg [189B]
Get: 3 file: edgy-updates Release.gpg [189B]
Get: 4 file: edgy-commercial Release.gpg [191B]
Get: 5 file: edgy-plf Release.gpg [189B]
Get: 6 file: edgy Release.gpg [189B]
Get: 7 file: edgy Release.gpg [189B]
Get: 8 file: edgy Release [34.7kB]
Get: 9 file: edgy-security Release [19.6kB]
Get: 10 file: edgy-updates Release [19.6kB]
Get: 11 file: edgy-commercial Release [4874B]
Get: 12 file: edgy-plf Release [9454B]
Get: 13 file: edgy Release [5755B]
Get: 14 file: edgy Release [4147B]
Ign file: edgy/main Packages
Ign file: edgy/restricted Packages
Ign file: edgy/universe Packages
Ign file: edgy/multiverse Packages
Ign file: edgy/main Sources
Ign file: edgy/restricted Sources
Ign file: edgy/universe Sources
Ign file: edgy/multiverse Sources
Ign file: edgy-security/main Packages
Ign file: edgy-security/restricted Packages
Ign file: edgy-security/universe Packages
Ign file: edgy-security/multiverse Packages
Ign file: edgy-security/main Sources
Ign file: edgy-security/restricted Sources
Ign file: edgy-security/universe Sources
Ign file: edgy-security/multiverse Sources
Ign file: edgy-updates/main Packages
Ign file: edgy-updates/restricted Packages
Ign file: edgy-updates/universe Packages
Ign file: edgy-updates/multiverse Packages
Ign file: edgy-updates/main Sources
Ign file: edgy-updates/restricted Sources
Ign file: edgy-updates/universe Sources
Ign file: edgy-updates/multiverse Sources
Ign file: edgy-plf Release
Ign file: edgy Release
Ign file: edgy Release
Ign file: edgy-commercial/main Packages
Ign file: edgy-plf/free Packages
Ign file: edgy-plf/non-free Packages
Ign file: edgy-plf/free Sources
Ign file: edgy-plf/non-free Sources
Ign file: edgy/main-edgy Packages
Ign file: edgy/main Packages
Fetched 99.5kB in 1s (73.2kB/s)
Reading package lists... Done
W: GPG error: file: edgy-plf Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY F120156012B83718
W: GPG error: file: edgy Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 31A5F97FED8A569E
W: GPG error: file: edgy Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 18B52FE3521A9C7C
W: You may want to run apt-get update to correct these problems

Fix the NO_PUBKEY warnings

The warnings occur because I don’t have those keys in my keyring. This fixes that:-

alan@multivac:~$ sudo gpg --keyserver subkeys.pgp.net --recv F120156012B83718
gpg: requesting key 12B83718 from hkp server subkeys.pgp.net
gpg: key 12B83718: public key "Lionel Le Folgoc (mr_pouit) " imported
gpg: Total number processed: 1
gpg:               imported: 1
alan@multivac:~$ sudo gpg --export --armor F120156012B83718 | sudo apt-key add -
OK
alan@multivac:~$ sudo gpg --keyserver subkeys.pgp.net --recv 31A5F97FED8A569E
gpg: requesting key ED8A569E from hkp server subkeys.pgp.net
gpg: key ED8A569E: public key "Quinn Storm " imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg:               imported: 1
alan@multivac:~$ sudo gpg --export --armor 31A5F97FED8A569E | sudo apt-key add -
OK
alan@multivac:~$ sudo gpg --keyserver subkeys.pgp.net --recv 18B52FE3521A9C7C
gpg: requesting key 521A9C7C from hkp server subkeys.pgp.net
gpg: key 521A9C7C: public key "Justin Hayes (Automatix Repository Master) " imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg:               imported: 1
alan@multivac:~$ sudo gpg --export --armor 18B52FE3521A9C7C | sudo apt-key add -
OK

Update again
..to show those keys got imported correctly in the last step.

alan@multivac:~$ sudo apt-get update
Ign file: edgy/main Translation-en_GB
Ign file: edgy/restricted Translation-en_GB
Ign file: edgy/universe Translation-en_GB
Ign file: edgy/multiverse Translation-en_GB
Ign file: edgy-security/main Translation-en_GB
Ign file: edgy-security/restricted Translation-en_GB
Ign file: edgy-security/universe Translation-en_GB
Ign file: edgy-security/multiverse Translation-en_GB
Ign file: edgy-updates/main Translation-en_GB
Ign file: edgy-updates/restricted Translation-en_GB
Ign file: edgy-updates/universe Translation-en_GB
Ign file: edgy-updates/multiverse Translation-en_GB
Ign file: edgy-commercial/main Translation-en_GB
Ign file: edgy-plf/free Translation-en_GB
Ign file: edgy-plf/non-free Translation-en_GB
Ign file: edgy/main-edgy Translation-en_GB
Ign file: stable Release.gpg
Ign file: stable/non-free Translation-en_GB
Ign file: edgy/main Translation-en_GB
Ign file: stable Release
Get: 1 file: edgy Release.gpg [191B]
Ign file: stable/non-free Packages
Get: 2 file: edgy-security Release.gpg [189B]
Get: 3 file: edgy-updates Release.gpg [189B]
Get: 4 file: edgy-commercial Release.gpg [191B]
Get: 5 file: edgy-plf Release.gpg [189B]
Get: 6 file: edgy Release.gpg [189B]
Get: 7 file: edgy Release.gpg [189B]
Get: 8 file: edgy Release [34.7kB]
Get: 9 file: edgy-security Release [19.6kB]
Get: 10 file: edgy-updates Release [19.6kB]
Get: 11 file: edgy-commercial Release [4874B]
Get: 12 file: edgy-plf Release [9454B]
Get: 13 file: edgy Release [5755B]
Get: 14 file: edgy Release [4147B]
Ign file: edgy/main Packages
Ign file: edgy/restricted Packages
Ign file: edgy/universe Packages
Ign file: edgy/multiverse Packages
Ign file: edgy/main Sources
Ign file: edgy/restricted Sources
Ign file: edgy/universe Sources
Ign file: edgy/multiverse Sources
Ign file: edgy-security/main Packages
Ign file: edgy-security/restricted Packages
Ign file: edgy-security/universe Packages
Ign file: edgy-security/multiverse Packages
Ign file: edgy-security/main Sources
Ign file: edgy-security/restricted Sources
Ign file: edgy-security/universe Sources
Ign file: edgy-security/multiverse Sources
Ign file: edgy-updates/main Packages
Ign file: edgy-updates/restricted Packages
Ign file: edgy-updates/universe Packages
Ign file: edgy-updates/multiverse Packages
Ign file: edgy-updates/main Sources
Ign file: edgy-updates/restricted Sources
Ign file: edgy-updates/universe Sources
Ign file: edgy-updates/multiverse Sources
Ign file: edgy-commercial/main Packages
Ign file: edgy-plf/free Packages
Ign file: edgy-plf/non-free Packages
Ign file: edgy-plf/free Sources
Ign file: edgy-plf/non-free Sources
Ign file: edgy/main-edgy Packages
Ign file: edgy/main Packages
Fetched 99.5kB in 0s (383kB/s)
Reading package lists... Done

Yay!

Install stuff

Here’s where we try to install stuff off the local mirror. I’ll just get a small package. Note that it doesn’t copy the package to the local filesystem “Need to get 0B”, but instead unpacks it directly from the repo “Unpacking cowsay (from …/c/cowsay/cowsay_3.03-8_all.deb) …”. All very good stuff. Like it.

alan@multivac:~$ sudo apt-get install cowsay
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed
  cowsay
0 upgraded, 1 newly installed, 0 to remove and 23 not upgraded.
Need to get 0B/17.9kB of archives.
After unpacking 274kB of additional disk space will be used.
Selecting previously deselected package cowsay.
(Reading database ... 156031 files and directories currently installed.)
Unpacking cowsay (from .../c/cowsay/cowsay_3.03-8_all.deb) ...
Setting up cowsay (3.03-8) ...

Test installed stuff

alan@multivac:~$ cowsay apt-mirror rocks!
 ___________________
< apt-mirror rocks! >
 -------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

Test upgrading

Lets just make sure an upgrade works.

alan@multivac:~$ sudo apt-get upgrade
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages have been kept back:
python-adns python-clientcookie python-crypto python-egenix-mxproxy python-egenix-mxstack python-egenix-mxtexttools python-htmlgen
python-htmltmpl python-jabber python-kjbuckets python-ldap python-mysqldb python-pam python-pexpect python-pylibacl python-pyopenssl
python-pyxattr python-simpletal python-soappy python-sqlite python-syck python-xmpp
The following packages will be upgraded:
ubuntu-docs
1 upgraded, 0 newly installed, 0 to remove and 22 not upgraded.
Need to get 0B/4984kB of archives.
After unpacking 123kB disk space will be freed.
Do you want to continue [Y/n]?
(Reading database … 156091 files and directories currently installed.)
Preparing to replace ubuntu-docs 6.10.3 (using …/ubuntu-docs_6.10.4_all.deb) …
Unpacking replacement ubuntu-docs …
Setting up ubuntu-docs (6.10.4) …

Future options

What I will likely do is keep this USB hard disk up to date but rsync the contents to a local fileserver so that I have it accessible not only via USB but also via NFS/SMB. That way I can share it out over the network. I don’t really want to share out a USB hard disk, as it’s a transient connection. I’d rather share out a permanent directory on a fileserver.

I have a fileserver called “hal” which I could backup to like this:-

alan@multivac:~$ rsync -avz -e ssh /media/usbdisk/repo alan@hal:/mnt/media/

That will copy the entire contents of my repository over the network via SSH to /mnt/media on the server hal.

I could reduce the overall download size by eliminating some stuff. For example I could choose not to download all the source packages by commenting out the lines starting “deb-src”. I could also reduce the number of architetures, for example not downloading the AMD64 binaries because I don’t (currently) have any AMD64 based systems.

My ISP provides me with a higher bandwidth allocation at night than during the day. So it might also be useful to schedule an apt-mirror via cron to run during the nightime hours to take advantage of this.

19 thoughts on “Creating an Ubuntu repository mirror with apt-mirror”

  1. I keep getting the following error:

    apt-mirror: can’t utime /var/spool/apt-mirror/mirror/mirrors.kernel.org/ubuntu/dists/jaunty/Release at /usr/bin/apt-mirror line 494.

    I have searched everywhere and have not been able to find what utime?

  2. Is it possible to restrict the list of packages to be mirrored locally?

    If yes, could someone please help me in finding how I can specify only a certain set of .deb files to be mirrored locally? E.g. if I know for sure that I need the packages from files: x.deb, y.deb and z.deb only, then what should be my mirror.list file?

    Thanks in advance for all the help.

    –Sayali

  3. Hi!

    Thanks for this tutorial… its really great, I am taking advantage of this information…! Wonderfull!!!

  4. One obvious but oft overlooked possibility that had me confused for an age is the number of concurrent connections permitted by the site you are trying to mirror from.

    I had to reduce the number of threads in mirror.list to 5 (the max allowed by my source site) before I was successful

  5. What apt-mirror actually does is only download packages for the architecture on which it is running. At least, that’s the default behaviour. So if the computer running apt-mirror is an i386 machine, then you won’t get PPC or AMD64 packages, nor any other architecture. People using this software to mirror Debian servers are probably quite grateful for this, but sadly there’s not a lot of documentation for apt-mirror.

    It seems you can specify a default architecture to mirror on the “set defaultarch” line. That’s useful if you want to mirror one arch on a server of a different arch. If you want to mirror multiple archs you have to specify lines for each in the config file, for example:
    deb-i386 http://gb.archive.ubuntu.com/ubuntu feisty main restricted universe multiverse
    deb-amd64 http://gb.archive.ubuntu.com/ubuntu feisty main restricted universe multiverse

  6. I used the above procedure to mirror the i386 ubuntu repo. I can use it to update and install new software on existing systems (after source.list has been modified) that’s no problem. What’s frustrating, is that I CANNOT use the local mirror to install a NEW ubuntu install using the net installer CD!!! It complains that the Release file is not valid! When I browse the local repo I can see the Release file (but it obviously contains info for other architectures). Is there a way to regenerate the local Release file so that it is “proper” by means of a script? so that it doesn’t refer to packages for architectures that are not present? Would really appreciate any help – as that’s why I wanted to set up a local mirror in the first place – to be able to install multiple systems from the local LAN. Thanks.

  7. When I run sudo apt-mirror -d, I get the following.

    Downloading 21 index files using 20 threads…
    Begin time: Mon Oct 8 12:38:01 2007
    [20]… [19]… [18]… [17]… [16]… [15]… [14]… [13]… [12]… [11]… [10]… [9]… [8]… [7]… [6]… [5]… [4]… [3]… [2]… [1]… [0]…
    End time: Mon Oct 8 12:42:03 2007

    Proceed indexes: [Psh: cannot open us.archive.ubuntu.com/ubuntu//dists/feisty/main/binary-i386/Packages.gz: No such file
    apt-mirror: can’t open index in proceed_index_gz at /usr/bin/apt-mirror line 368.

    Any ideas on whats wrong.

  8. I was able to netboot and install from a local mirror thanks to this resource and a few others. However, when netbooting, additional mirror sets are required. I posted some information about this on the Ubuntu wiki:

    https://help.ubuntu.com/community/Installation/LocalNet

    My apt-mirror section could probably use some input by someone who knows something. I’m just a guy who patiently bungled my way to success with a lot of help from blogs like this.

  9. You must un comment the line below from your /etc/apt/mirror.list config for it to work, or else everything will download to /var/spool/apt-mirror as opposed to /media/usbdisk/repo.

    set mirror_path $base_path/mirror
    set skel_path $base_path/skel
    set var_path $base_path/var
    set cleanscript $var_path/clean.sh

  10. I am having trouble with installing new updates that have been downloaded to my local repository with apt-mirror. I have downloaded both deb-i386 and deb-amd64 to a local repository in hopes of supporting multiple machines on my home network. However, after weeks of downloading updates, my update manager does not find any updates to install. I am using this format in my sources.list file:

    deb file:/var/spool/apt-mirror/mirror/archive.ubuntu.com/ubuntu hardy main restricted universe multiverse
    deb-src file:/var/spool/apt-mirror/mirror/archive.ubuntu.com/ubuntu hardy main restricted universe multiverse
    deb file:/var/spool/apt-mirror/mirror/archive.ubuntu.com/ubuntu hardy-security main restricted universe multiverse
    deb file:/var/spool/apt-mirror/mirror/archive.ubuntu.com/ubuntu hardy-updates main restricted universe multiverse

    I have verified that apt-mirror is working and downloading files.

    Any suggestions about what is wrong with my configuration?
    Thanks.

Leave a Reply

Additional comments powered by BackType