This site is now 100% read-only, and retired.

XML logo

Using apt-move to create an apt snapshot CD
Posted by lee on Thu 16 Feb 2006 at 01:04
Tags: none.

If you track unstable, then unless you run "apt-get clean", your apt cache (/var/cache/apt/archives/) will fill with downloaded debian packages. apt-move takes the files in the archives considered current and organises them into a repository that is apt accessible.

This directory can then be added to your local sources list, but you can also dump these repositories to CD or DVD and use them a supplementary CD sources during an installation process.

Firstly, set up the archive with "mkdir -p /srv/mirrors/debian/.disk" then configure apt-move via /etc/apt-move.conf to use LOCALDIR=/srv/mirrors/debian (and any other settings that apply to you. Then run "apt-move update".

The directory should now be suitable for use as an apt repository, either locally, via something like NFS, or used in an httpd configuration.

deb file:///srv/mirrors/debian/ unstable main

I also create subdirectories of /srv/mirrors/debian/ that contain files I might want during installation - such as gpg signing keys, additional downloads, and dumps from debconf, dpkg-query, deborphan etc.

"apt-move update && apt-get clean" should be run periodically, say once a week. When you're re-installing, or when the size of the repository is approaching the capacity of your CD or DVD you'll want to dump it out. (The following assumes that cdrecord is already configured with the apropriate defaults.)

echo "Debian backup (`date +%Y%m%d`)" > /srv/mirrors/debian/.disk/info

mkisofs -hide-rr-moved -allow-leading-dots -r -f \ 
 -V "`< /srv/mirrors/debian/.disk/info`" \ 
 -x /srv/mirrors/debian/.apt-move \ 
 /srv/mirrors/debian | cdrecord -v - 

Label the disk as "Debian backup (20060216)" where the date corresponds to the current date. You might also want to run "apt-cdrom add" to add the CD as an apt source.


Comments on this Entry

Re: Using apt-move to create an apt snapshot CD
Posted by Anonymous (74.12.xx.xx) on Wed 8 Feb 2012 at 15:05
This does not work. Perhaps there is something wrong with apt-move? I follow the instructions to the letter, and it accomplishes absolutely nothing.

[ Parent ]

Re: Using apt-move to create an apt snapshot CD
Posted by lee (87.236.xx.xx) on Wed 8 Feb 2012 at 15:13
[ View Weblogs ]
Sorry, I haven't used apt-move in years. If it doesn't appear to be creating the repositories you may need to file a bug with the maintainers.

[ Parent ]