Creating a debian mirror

Already on to something different. I’d like to create a debian mirror, but with only a very limited number of packages or sections in it, rather than maintaining an entire distribution. Installing the debmirror package is your first task. Once you’ve done that, you want to run the command but first you need to read the man page as there are loads of options.

Initially, I just wanted to download the Editors. To do that, I first needed to get the following public key:

gpg --keyserver wwwkeys.eu.pgp.net --recv-keys 4F368D5D

I knew that because, when I attempted to run debmirror initially, I got the following message:

gpg: Signature made Tue 31 May 2005 21:55:12 BST using DSA key ID 4F368D5D
gpg: Can't check signature: public key not found

A quick Google later and I managed to locate the above command to get the public key.

Next, I needed to create a directory for the mirror. I just created it in /tmp as I’m just wanting to test debmirror. Clearly, if you want to keep the packages, storing them in /tmp is a really bad idea.

mkdir /tmp/debmirror

Then, I ran the command to get the packages:

debmirror --nosource \\
          --host ftp.uk.debian.org \\
          --dist=woody \\
          --exclude-deb-section=admin \\
          --exclude-deb-section=base \\
          --exclude-deb-section=comm \\
          --exclude-deb-section=devel \\
          --exclude-deb-section=doc \\
          --exclude-deb-section=electronics \\
          --exclude-deb-section=embedded \\
          --exclude-deb-section=games \\
          --exclude-deb-section=gnome \\
          --exclude-deb-section=graphics \\
          --exclude-deb-section=hamradio \\
          --exclude-deb-section=interpreters \\
          --exclude-deb-section=kde \\
          --exclude-deb-section=libdevel \\
          --exclude-deb-section=libs \\
          --exclude-deb-section=mail \\
          --exclude-deb-section=math \\
          --exclude-deb-section=misc \\
          --exclude-deb-section=net \\
          --exclude-deb-section=news \\
          --exclude-deb-section=oldlibs \\
          --exclude-deb-section=otherosfs \\
          --exclude-deb-section=perl \\
          --exclude-deb-section=python \\
          --exclude-deb-section=science \\
          --exclude-deb-section=shells \\
          --exclude-deb-section=sound \\
          --exclude-deb-section=tex \\
          --exclude-deb-section=text \\
          --exclude-deb-section=utils \\
          --exclude-deb-section=web \\
          --exclude-deb-section=x11 \\
          /tmp/debmirror

That appears to work. I excluded all Debian Sections except Editors, and incredibly it downloaded only the editors. 141Mb, mind you. Emacs and XEmacs are damn huge.

Leave a Reply