apt-mirror with mutliple architectures on debian etch

I talked about this a bit in an earlier post but wanted to talk about it a bit more as it comes to multiple architectures. We run vmware vms on debian hosts with gobs of memory so generally they’re amd64/x64 but often the guests are i386/32bit debian installs to not have to deal with the ickyness of amd64 and compatibility like libraries.

apt-mirror supports multiple architectures but normally searching for information about it just pulls up tons of pages advertising as much. I finally found an example here off which I based my configs.

After installing apt-mirror (‘apt-get install apt-mirror’ on etch), a config file (/etc/apt/mirror.list) like:

## The default configuration options (uncomment and change to override)
##
#
# 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 defaultarch
# set nthreads 20
#
set _tilde 0

deb http://ftp.us.debian.org/debian/ etch main main/debian-installer
deb-amd64 http://ftp.us.debian.org/debian etch main main/debian-installer
deb-src http://ftp.us.debian.org/debian/ etch main

deb http://security.us.debian.org/ etch/updates main contrib
deb-amd64 http://security.us.debian.org/ etch/updates main contrib
deb-src http://security.us.debian.org/ etch/updates main contrib

The above was about 29GB before the deb-amd64 lines were added and apt-mirror is throwing in another 6.5GB right now for the deb-amd64 lines.

This howto says “In my tests I mirrored the main, contrib, and non-free sections of Debian Sarge and the main, restricted, and universe sections of Ubuntu Edgy Eft which took about 25GB of hard disk space and about 6 hours of download time on a 16MBit DSL line.” Note that does not included deb-src: “Also, I don’t want to mirror the source packages because in 95% of all installations you don’t need source packages, and they need a lot of space on the hard disk.”

Also they say “I will not mirror security updates in this tutorial – I think it’s a good idea to always download security updates directly from the internet. That way you can be sure you get the latest ones.” however I’ve seen when mirroring gutsy that important and large packages sometimes end up in the security updates. It’s really time consuming and annoying when a base package gets a security update and suddenly all your network installs slow down because you have to wait for it.

Running ‘su – apt-mirror -c apt-mirror’ will get you a tree in /var/spool/apt-mirror that looks like (ignoring the pool tree, where the debs are actually kept:

# tree -d -L 6 . -I pool
.
|– ftp.us.debian.org
| `– debian
| `– dists
| `– etch
| `– main
| |– binary-amd64
| |– binary-i386
| |– debian-installer
| `– source
`– security.us.debian.org
`– dists
`– etch
`– updates
|– contrib
| |– binary-amd64
| |– binary-i386
| `– source
`– main
|– binary-amd64
|– binary-i386
`– source

You’ll need to install apache and configure a tree to match a repository. Mines a little hacked with symlinks because I needed a link from stable to etch for the network install. In /var/www:

.
|– debian
| |– dists
| | |– etch -> /var/spool/apt-mirror/mirror/ftp.us.debian.org/debian/dists/etch/
| | `– stable -> etch
| `– pool -> /var/spool/apt-mirror/mirror/ftp.us.debian.org/debian/pool/
|– preseed
`– security -> /var/spool/apt-mirror/mirror/security.us.debian.org

Pay particular note to the line wrapping depending on your screen width. For instance /var/www/debian/dists/etch is actually a symlink to /var/spool/apt-mirror/mirror/ftp.us.debian.org/debian/dists/etch while /var/www/debian/dists/stable is a symlink to /var/www/debian/dists/etch. Preseed is just a folder I keep my preseed config files in.

The lines in your /etc/apt/sources.list should look something like:

deb http://yourhost.local/debian/ etch main
deb-src deb http://yourhost.local/debian/ etch main
deb http://yourhost.local/security etch/updates main

it’s somewhat intelligent about knowing what architecture it is. it’ll need more tuning that that, you’ll find edge cases like security update source packages that you oughtta be able to fix pretty easy. I haven’t tuned it myself yet because it’s not a priority at this point.

1 thought on “apt-mirror with mutliple architectures on debian etch

  1. Pingback: apt-mirror Update « A Stay At Home Dad

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload the CAPTCHA.