[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Can I configure apt to add installer components to my archive



Title: Re: Can I configure apt to add installer components to my archive

>I use apt-move to maintain a local mirror of sarge on my LAN, so that each package is downloaded only
> once from the net and is then available to all machines.
>I notice that the debian installer components are also kept in the same mirror structure on the CD, but
>under dists/sarge/main/debian-installer/binary-i386 rather than /dists/sarge/main/binary-i386 for the base
>packages.
>Is it possible to configure apt to add those to my local archive? By adding something to sources.list, or
>directly to apt-move.conf, or some other way?

Well, I worked this out in the end. You cannot just point apt at the d-i CD because it lacks a Release file for main/debian-installer (ie. dists/sarge/main/debian-installer/binary-i386/Packages.gz exists but not dists/sarge/main/debian-installer/binary-i386/Release). This means that although apt-move correctly copies all the udebs into the local archive, it doesn't create the debian-installer directory under dists/testing/main, nor create the Packages files.

So, here's the solution, if you're interested in downloading the installer components from your local archive (so you don't have the change the mirror for the Install Base System and Install Kernel steps):

1. copy the entire d-i CD onto your HD (I'll use /hfp in this example, short for /home/ftp/pub). (You only actually need the dists/ and pool/ trees, but it's probably quicker to copy the whole lot - you'll get all the space back very shortly.)

2. create the file /hfp/dists/sarge/main/debian-installer/binary-i386/Release and put in the two md5sums found in /hfp/dists/sarge/Release for main/debian-installer/Packages and Packages.gz (if you're unsure what else to put in the Release file, use /hfp/dists/sarge/main/binary-i386/Release as a template - a bunch of header lines and then the two lines with the md5sums). You can run md5sum on /hfp/dists/sarge/main/debian-installer/binary-i386/Packages and Packages.gz yourself to make sure, but they should be the same as the ones in /hfp/dists/sarge/Release.

3. add "ftp //hostname/pub sarge main/debian-installer" to your /etc/apt/sources.list file (where hostname is your own hostname, obviously, and pub/ is the bottom of your /hfp path). Don't forget to comment it out again after we're done. (This assumes that you run an ftp server for your local mirror ... it would probably work with http, but I'm not sure that apt-move would cope with copy ...)

4. run "apt-get update" (this will add knowledge of the installer packages to your local cache - normally in /var/cache/apt).

5. add "hostname" to your APTSITES string in /etc/apt-move.conf (again, don't forget to remove it when we're done).

6. run "apt-move get" to tell apt-move all about the new packages

7. run "apt-move movefile /hfp/pool/main/*/*/*" to get all the files moved into your local mirror (you should test with -t first if you're nervous).

8. run "apt-move packages" to build the Packages and Release files for your mirror and make the installer components available. This is the bit that kept failing before I added step 2 above - it copied all the packages over fine, but then wouldn't create /mirror/dists/sarge/main/debian-installer or the Packages and Release files. Don't forget to re-set sources.list and apt-move.conf to what they were before, otherwise they will get confused (until you want to upgrade your archive of installer components). You can also nuke the rest of /hfp once everything's safely in the mirror.

9. That's it - now you can select your local mirror from the d-i main menu, and it will provide both the installer components from the "Download Installer Components" step, and the other packages for the "Install Base System" and "Install Kernel" steps. It'll also be put in sources.list for your new build.

So, I can install sarge from any machine on my LAN with just two floppies. I guess I might need the net_drivers floppy sometimes ....

... ok so most machines could just use the d-i CD, but it's nice to know it can be done without (I tend to use CDRWs for the d-i ISOs, and some of my older CD-ROM drives can't read CDRWs ....).

Cheers,

CC


Reply to: