jigdo – A fantastic tool to maintain Debian Linux images

September 29, 2010

Debian distribution of Linux is very huge – present testing version -squeeze running into 8 DVD’s. The updates are frequent. Downloading iso images every time is a waste of resource. Debian provides jigdo, a tool which help us in fetching only the changes and creating the iso. There is a gui package jigdo and command-line one called jigdo-lite. I have not tried the gui one. How to use jigdo-lite?  Let us see by means of an example:

Problem: I have debian Lenny stable version 5.03. Recently 5.06 has been released. I want to upgrade the iso image available with me.

Step 1: Get .jigdo file from debian site

wget http://cdimage.debian.org////debian-cd/5.0.6/i386/jigdo-cd/debian-506-i386-CD-1.jigdo

alternatively you can download using a browser.

Step 2: Download jigdo template file.

wget http://cdimage.debian.org////debian-cd/5.0.6/i386/jigdo-cd/debian-506-i386-CD-1.template

Step 3: Mount existing iso in a directory

mount -o loop debian.5.03.iso /media/loop/1

Note: If you have additional CD/DVD’s you can mount them also under different name.

Step 4: Run jigdo-lite

jigdo-lite debian-506-i386-CD-1.jigdo

Step 5: jigdo-lite will run  as above will ask for few information

Step 5a. Directories to scan. Jigdo will look for packages in these directories. Specify /mount/loop/1 here. If you have additional directories you can specify them all. Here is the screen dump

jigdo-lite debian-506-i386-CD-1.jigdo

Jigsaw Download “lite”
Copyright (C) 2001-2005  |  jigdo@
Richard Atterer          |  atterer.net
Getting mirror information from /etc/apt/sources.list

Images offered by `debian-506-i386-CD-1.jigdo’:
1: ‘Debian GNU/Linux 5.0.6 “Lenny” – Official i386 CD Binary-1 20100904-18:58 (20100904)’ (debian-506-i386-CD-1.iso)

Further information about `debian-506-i386-CD-1.iso’:
Generated on Sat, 04 Sep 2010 19:02:11 +0000

If you already have a previous version of the CD you are
downloading, jigdo can re-use files on the old CD that are also
present in the new image, and you do not need to download them
again. Mount the old CD ROM and enter the path it is mounted under
(e.g. `/mnt/cdrom’).
Alternatively, just press enter if you want to start downloading
the remaining files.
Files to scan: /media/loop/1

After pressing enter  jigdo will process the template. It will scan the directories we have specified and look for required packages. If a particular package available in local system is same as in mirror, it will use local copy while creating iso. After scanning it will identify packages required to be downloaded and starts downloading the packages.

Not downloading .template file – `debian-506-i386-CD-1.template’ already present
Found 816 of the 1005 files required by the template
13%   90126k/661740k  writing image

Step 5b.Debian mirror to use. Enter the debian mirror from where packages should be downloaded. Normally I use http://ftp.us.debian.org/ or http://ftp.iitm.ac.in/debian.

The jigdo file refers to files stored on Debian mirrors. Please
choose a Debian mirror as follows: Either enter a complete URL
pointing to a mirror (in the form
`ftp://ftp.debian.org/debian/’), or enter any regular expression
for searching through the list of mirrors: Try a two-letter
country code such as `de’, or a country name like `United
States’, or a server name like `sunsite’.
Debian mirror [cdrom:[Debian]: http://ftp.debian.org/debian

Step 6. After finishing downloads, jigdo will create the iso

Found 1 of the 1 files required by the template
Successfully created `debian-506-i386-CD-1.iso’

The fact that you got this far is a strong indication that `debian-506-i386-CD-1.iso’
was generated correctly. I will perform an additional, final check,
which you can interrupt safely with Ctrl-C if you do not want to wait.

OK: Checksums match, image is good!

That is all, the image is ready for use. Do not forget to unmount the old iso image. While using jigdo take care about following

a.Keep the existing images in a separate directory, not in the same directory where jigdo will be run.

b.Ensure enough space, especially in case of DVD images.

Advantages of using jigdo

  • Ensures minimal network usage – just download what is required.
  • Time is saved compared with full download
  • Lighter load on debian mirrors
  • In many organisation downloading large files like DVD images are banned. jigdo enables us to download in pieces and reassemble.
  • Downloading can be interrupted and resumed later.
  • If you have DVD image you can create CD image without downloading any package.