Tuesday, February 07, 2006

Building Ubuntu Local Repository (CD)

I've just read from this site about creating Ubuntu DVD Repositories. I thought I need to create such local repo, but in CDs, as I don't have DVD burner.

First, I created local copy from main repository using debmirror.
In this case, I am using mirror from CBN.

$ debmirror --nosource -m --passive --host=ubuntu.cbn.net.id --root=Ubuntu/ --method=http--progress --dist=breezy --section=main --arch=i386 ubuntu/ --ignore-release-gpg

Creating destination folders for partitioning

$ mkdir ubuntu-cd

Then I partitioned those files using debpartial

$ debpartial --nosource --dirprefix=ubuntu --section=main --dist=breezy --size=CD74 ubuntu/ ubuntu-cd/

After the packages lists had been generated, I created the symlink to the corresponding packages using debcopy script. It can be downloaded from here.

$ ruby debcopy -l ubuntu/ ubuntu-cd/ubuntu0
$ ruby debcopy -l ubuntu/ ubuntu-cd/ubuntu1
$ ruby debcopy -l ubuntu/ ubuntu-cd/ubuntu2
$ ruby debcopy -l ubuntu/ ubuntu-cd/ubuntu3
$ ruby debcopy -l ubuntu/ ubuntu-cd/ubuntu4

The partitioned folders then converted into iso image files, and burnt.

$ mkisofs -f -J -r -o ubuntu-cd-main-0.iso ubuntu-cd/ubuntu0
$ mkisofs -f -J -r -o ubuntu-cd-main-1.iso ubuntu-cd/ubuntu1
$ mkisofs -f -J -r -o ubuntu-cd-main-2.iso ubuntu-cd/ubuntu2
$ mkisofs -f -J -r -o ubuntu-cd-main-3.iso ubuntu-cd/ubuntu3
$ mkisofs -f -J -r -o ubuntu-cd-main-4.iso ubuntu-cd/ubuntu4

$ sudo cdrecord -v dev=/dev/cdrw speed=32 driveropts=burnfree -dao -eject ubuntu-cd-main-0.iso
$ sudo cdrecord -v dev=/dev/cdrw speed=32 driveropts=burnfree -dao -eject ubuntu-cd-main-1.iso
$ sudo cdrecord -v dev=/dev/cdrw speed=32 driveropts=burnfree -dao -eject ubuntu-cd-main-2.iso
$ sudo cdrecord -v dev=/dev/cdrw speed=32 driveropts=burnfree -dao -eject ubuntu-cd-main-3.iso
$ sudo cdrecord -v dev=/dev/cdrw speed=32 driveropts=burnfree -dao -eject ubuntu-cd-main-4.iso

The method to create repo-cd for universe & multiverse repository is similar.
I Just changed the apropriate parameter in debmirror & debpartial.
Now I have access to ubuntu repository even when I am not connected to the net. Right now, I am currently trying to create repo from breezy-updates & security. Hopefully, I will have it mirrored before it changes (again) :-)


gambas van brewen said...

i dont quite understand.
Is it mean that u had to download them all first, then burn it, or you download and burn them at the same time.

Xlylith said...

They are batch processes.
Therefore those steps are sequential
Unfortunately, due to limited hd-size, I only made main cd repo only :(