Author: Sven Hoexter
genbasedircommand. But what I want are CDs that work with the apt-cdrom program. Apt-cdrom adds the package lists from a base directory on the CD to your local system and adds a line identifying the CD to your sources list.
Preparing a CD
Here is what you can do to give a friend with slow Internet access a CD with the add-on packages for SUSE Linux 9.1 available on ftp.gwdg.de.
The first step is to create a directory called SUSE-add-on under a directory called susecd using the command
mkdir -p ~/susecd/SUSE-add-on.
Next, download all the sections you need (in my case RPMS.packman, RPMS.packman-i686, and RPMS.suser-rbos) with
wget -r --retr-symlinks ftp://ftp.gwdg.de/pub/linux/suse/apt/SuSE/9.1-i386/RPMS.packman
wget -r --retr-symlinks ftp://ftp.gwdg.de/pub/linux/suse/apt/SuSE/9.1-i386/RPMS.packman-i686
wget -r --retr-symlinks ftp://ftp.gwdg.de/pub/linux/suse/apt/SuSE/9.1-i386/RPMS.suser-rbos
This gives you the following structure:
The next step is to generate the package lists in the base directory for the CD. Note: you need to have APT-RPM installed on your system to have the genbasedir program.
genbasedir --flat --bloat --progress ~/susecd/SuSE-add-on/
If everything goes right, you should have a susecd/SuSE-add-on/base subdirectory with the following files:
There’s one more thing you have to do before you create the CD image with
mkisofs. You need to add another subdirectory called .disk under susecd, which will contain a file named info for apt-cdrom to read. The info file should contain a description for the CD, which will appear in the sources.list later. To do that, enter these commands:
echo "SuSE Linux 9.1 Unofficial Add-on CD i386 20040722" > ~/susecd/.disk/info
Now you’re ready to master the ISO file with
mkisofs and burn it with
mkisofs -J -l -r -o /tmp/suseaddon.iso ~/susecd
Back at our destination
You can now carry your new “apt-powered” CD to your destination system and add it by entering the command
apt-cdrom add. Apt-cdrom will respond:
Using CD-ROM mount point /mnt/cdrom/
Please insert a Disc in the drive and press enter
Do as requested, and apt-cdrom continues:
Scanning Disc for index files.. Found 3 package indexes and 0 source indexes,
This Disc is called:
'SuSE Linux 9.1 Unofficial Add-on CD i386 20040722'
Reading Indexes... Done
Writing new source list
Source List entries for this Disc are:
rpm cdrom:[SuSE Linux 9.1 Unofficial Add-on CD i386 20040722]/ SuSE-add-on packman packman-i686 suser-rbos
If you take a look at your /etc/apt/sources.list you’ll find the entry for your CD. Now you have all the RPMs from the CD available for installation by the APT-RPM tools. You can remove this collection by simply deleting the line from your sources.list. To re-add the CD at a later time, just repeat the
apt-cdrom add commands above.