How-To Make Ubuntu DVDs Including Main, the Universe and Everything
Quick and Easy
Just download my bash script gen-ubuntu-dvds.sh and start it in a folder with at least 30GB of free space. After some time you have (next to some other stuff) four ISO images of Ubuntu including the repositories main, restricted, universe, and multiverse for ubuntu, ubuntu-security, and ubuntu-updates. To get the latest updates simply re-run the script. Don’t worry, only updated packages will be downloaded this time.
Step by Step
Sometimes I need to install Ubuntu on a computer without or with a very low bandwidth connection to the Internet. The major distros come with DVDs including most packages one might need. The Ubuntu DVDs only contain packages supported by Canonical and therefore lots of goodies are missing like ScummVM, Wesnoth or Supertux
Here is a short description how to generate your own set of Ubuntu DVDs including the repositories main, restricted, universe, and multiverse including all updates and security patches. These packages take about 14GB and contain very much of the open source world. They fit on 3 DVDs and one CD.
First you need to set up a local mirror of the Ubuntu repositories. The following command mirrors main, restricted, universe and multiverse from dapper, dapper-security, and dapper-updates. This takes a while, as you are downloading all of Ubuntu.
$ debmirror --nosource -m --passive --host=archive.ubuntu.com --root=ubuntu/ --method=ftp --progress --dist=dapper,dapper-security,dapper-updates --section=main,restricted,universe,multiverse --arch=i386 ubuntu/ --ignore-release-gpg
Then the directory has to be split up in DVD sized chunks and package descriptions for these directories have to be generated.
$ debpartial --nosource --dirprefix=ubuntu --section=main,restricted,universe,multiverse --dist=dapper,dapper-security,dapper-updates --size=DVD ubuntu/ ubuntu-dvds/
Using debcopy the newly generated directories for the DVDs are filled with symlinks to the actual packages. Debcopy is included in the package debpartial and has to be extracted first.
$ cp /usr/share/doc/debpartial/examples/debcopy.gz .
$ gunzip debcopy.gz
$ ruby debcopy -l ubuntu/ ubuntu-dvds/ubuntu0
$ ruby debcopy -l ubuntu/ ubuntu-dvds/ubuntu1
$ ruby debcopy -l ubuntu/ ubuntu-dvds/ubuntu2
$ ruby debcopy -l ubuntu/ ubuntu-dvds/ubuntu3
And finally the ISO images are generated.
$ mkisofs -f -J -r -V "Ubuntu 6.06.x $(date -I) 1/4" -o ubuntu-6.06.x-$(date -I)-complete-i386-dvd1.iso ubuntu-dvds/ubuntu0
...
To burn the images simply browse with Nautilus to the folder and right click the image -> Write to Disk.
Much information has been taken from Ramon’s description. It has been extended to all repositories and distros (-security and -updates).
Feedback is very welcome! Please send me also info about issues you might encounter.









Very cool. This would have come in handy a few months ago, when I was without Internet access and had to reinstall Ubuntu. I’ll be keeping these around on my backup drive in case something like that comes up agin. Thanks!
August 18th, 2006 at 6:04 am
Would it be possible to get one copy of the dvds?
And pay for it…
September 5th, 2006 at 9:18 am
@John: I cannot send DVDs, but I found two shops in the internet which seem to sell something like this:
Shop1
Shop2
Both are in german, but I am certain that there are also english shops selling such DVDs. Try to google them.
As I am not affiliated with them I can of course not guarantee for it.
Burt
September 5th, 2006 at 2:11 pm
TheLinuxStore.ca carries them. They also include some migration software, Progression Desktop, for free.
September 5th, 2006 at 2:43 pm
[…] read more | digg story […]
September 5th, 2006 at 3:26 pm
[…] Just download my bash script gen-ubuntu-dvds.sh and start it in a folder with at least 30GB of free space. After some time you have (next to some other stuff) four ISO images of Ubuntu Dapper Drake including the repositories main, restricted, universe, and multiverse for ubuntu, ubuntu-security, and ubuntu-updates.read more | digg story […]
September 6th, 2006 at 9:51 am
I got this working on a RedHat system (debmirror is a perl script with a modereate number of dependencies after all). The deb package files are just ‘ar’ archives and can be unpacked like this:
ar xv debmirror_20060907.1_all.deb data.tar.gz
tar zxvf data.tar.gz
cd to an appropriate directory first (a directory ./usr will contain a local hierarchy). I strongly recommend that you don’t do this as root.
However, there is an issue with the debmirror script, which simply didn’t download anything in my hands. After some debugging, I found that the answer was to comment out the assignment to the $/ variable at around line 775:
say("Parse Packages and Sources files and add to the file list everything therein.");
{
local $/="\n\n"; #######Comment out this line
my ($filename, $size, $md5sum, $directory, $exclude, $include,
$architecture, $exclude_deb_section, $limit_priority, $deb_section,
$deb_priority);
I don’t know why no-one else has hit this problem (it may be something to do with the version of Compress::Zlib that I’m using), but hopefully this will be useful if anyone else trips over this.
November 20th, 2006 at 7:22 pm
you can use aptoncd for this it is very easy to install and configure check this link for nice tutorial
http://www.debianadmin.com/create-backup-of-all-packages-using-aptoncd-in-ubuntu.html
December 11th, 2006 at 11:45 pm
I tried and I got this:
Downloaded 13515 MiB in 28576s at 484.27 kiB/s
Errors:
Download of pool/universe/c/cl-series/cl-series_2.2.8-1_all.deb failed: Failed to establish connection.
Download of pool/universe/g/gst-plugins-bad0.10/gstreamer0.10-sdl_0.10.3-0ubuntu3_i386.deb failed: Failed to establish connection.
Failed to download files (2 errors)!
Reading dists/dapper/main/binary-i386/Packages.gz… failed
No such file or directory - ubuntu//dists/dapper/main/binary-i386/Packages.gz
find: /home/david/tmp/todoUbuntu/ubuntu-dvds/ubuntu0: No existe el fichero ó directorio
find: /home/david/tmp/todoUbuntu/ubuntu-dvds/ubuntu0: No existe el fichero ó directorio
Number of Copied Files: 0
Number of Ignored Files: 0
Number of Non-existence File: 0
find: /home/david/tmp/todoUbuntu/ubuntu-dvds/ubuntu1: No existe el fichero ó directorio
find: /home/david/tmp/todoUbuntu/ubuntu-dvds/ubuntu1: No existe el fichero ó directorio
Number of Copied Files: 0
Number of Ignored Files: 0
Number of Non-existence File: 0
find: /home/david/tmp/todoUbuntu/ubuntu-dvds/ubuntu2: No existe el fichero ó directorio
find: /home/david/tmp/todoUbuntu/ubuntu-dvds/ubuntu2: No existe el fichero ó directorio
Number of Copied Files: 0
Number of Ignored Files: 0
Number of Non-existence File: 0
find: /home/david/tmp/todoUbuntu/ubuntu-dvds/ubuntu3: No existe el fichero ó directorio
find: /home/david/tmp/todoUbuntu/ubuntu-dvds/ubuntu3: No existe el fichero ó directorio
Number of Copied Files: 0
Number of Ignored Files: 0
Number of Non-existence File: 0
./gen-ubuntu-dvds.sh: line 92: ubuntu-dvds/ubuntu0/README: No existe el fichero ó directorio
./gen-ubuntu-dvds.sh: line 92: ubuntu-dvds/ubuntu1/README: No existe el fichero ó directorio
./gen-ubuntu-dvds.sh: line 92: ubuntu-dvds/ubuntu2/README: No existe el fichero ó directorio
./gen-ubuntu-dvds.sh: line 92: ubuntu-dvds/ubuntu3/README: No existe el fichero ó directorio
mkisofs: Warning: -follow-links does not always work correctly; be careful.
INFO: UTF-8 character encoding detected by locale settings.
Assuming UTF-8 encoded filenames on source filesystem,
use -input-charset to override.
mkisofs: No such file or directory. Invalid node - ‘ubuntu-dvds/ubuntu0′.
mkisofs: Warning: -follow-links does not always work correctly; be careful.
INFO: UTF-8 character encoding detected by locale settings.
Assuming UTF-8 encoded filenames on source filesystem,
use -input-charset to override.
mkisofs: No such file or directory. Invalid node - ‘ubuntu-dvds/ubuntu1′.
mkisofs: Warning: -follow-links does not always work correctly; be careful.
INFO: UTF-8 character encoding detected by locale settings.
Assuming UTF-8 encoded filenames on source filesystem,
use -input-charset to override.
mkisofs: No such file or directory. Invalid node - ‘ubuntu-dvds/ubuntu2′.
mkisofs: Warning: -follow-links does not always work correctly; be careful.
INFO: UTF-8 character encoding detected by locale settings.
Assuming UTF-8 encoded filenames on source filesystem,
use -input-charset to override.
mkisofs: No such file or directory. Invalid node - ‘ubuntu-dvds/ubuntu3′.
December 12th, 2006 at 1:53 pm
This can be easier using AptOnCD application.
Thanks for the script! I downloaded it and started in a screen session. It ran without a problem and delivered me four up to date DVD’s . I would suggest that you add a check for mkisofs because I did not have that on my server and the first time I ran the script I had an error concerning this. After the apt-get mantra and a restart of the script it went flawlessly.
December 13th, 2006 at 10:53 am
Thanks Nicolas, I added the check for mkisofs.
Burt
December 13th, 2006 at 11:25 am
Hey Peter Keller, Thanks for the info on the fix up!
I spent about 4 hours on a gentoo machine trying to mirror and couldn’t figure it out until I read your comment!
December 21st, 2006 at 6:24 am
Ok might be good stuff but not for a new user like myself any way.
Have run the script from the above webb site and it takes 28 to 30 hr’s.
Ran the script from terminal to /media/hda9/z and it did build some directorys
however it did not build the iso’s or i cant find them. My dapper is on a smaller partition
on the same hard drive but there is not enough over head for the download to be worked
the partition is an vfat partition, is this mabe part of the problem or am i missing some parts
some where. Some direction would be nice and help in understanding the way a scrip is built
i have know idea of what if [ -z “${isodir}” ]; then means or any of the other stuff. Im not
a programmer so where do i look to fix this or learn some thing?
January 27th, 2007 at 8:26 pm
Ps sorry have searched and cant find the .iso’s where did thy get deposited? Have searched with
windows and ubuntu and cant find them, or if thy were even built.
January 27th, 2007 at 8:34 pm
Greetings!
I followed the written scripts, did the downloads and created the DVDs. Not sure if I should as this here, but in “Breezy Badger” (5.10) the DVDs appeared in the Synaptic Package Manager list (Settings > Repositories) under the Intallation Media tab. Dapper doesn’t show them. Odd. Any idea why?
Second question: are any keys needed to activate them? Synaptic warns of insecurities when installing from these disks. Just wondering what to do to prevent this.
Thanks!
February 7th, 2007 at 3:01 am
hi, this is a cool script! I ran it yesterday and it’s been 18 hours now and the script hasnt finished yet. How long does it take for it to finish? Thanks.
February 11th, 2007 at 3:39 am
It takes a long time. 18 hours is not unusual. Remember: you’re downloading all of Ubuntu. It’s going to take some time, glin.
Note: I’ve added this as a HowTo tutorial at Ubuntu Forums… slightly cleaned up, tweaked a bit and made for beginners. I’ve credited Burt and Ramon for their hard work. I’ll be maintaining the tutorial there (feel free to post questions).
Bob
February 11th, 2007 at 8:04 pm
yo any way of doing this from windows?
March 19th, 2007 at 11:50 pm
I am also interested in doing this from windows. I am trying to configure an Ubuntu box that does not and CANNOT have access to the internet. I’ve found myself going back and forth between the Feisty box and my windows machine, that is on the network.
I am very new to Linux/Ubuntu and i understand how APT works but without a net connection, its pretty useless… it almost seems like its not even worth the trouble to configure this OS, without some sort of internet connection…
June 21st, 2007 at 8:53 pm
Hi - great post/script!
I have a slightly different problem: I’d like to do all the downloads as in your program, but I’d like to store them all on a USB2.0 DRIVE that I can mount on a machine not connected to the Internet. Your solution is great with DVDs, but I have to keep swapping them (usually 4) to install most programs. If I had the “mirror” on the USB drive I wouldn’t have to swap DVDs. I’ve even tried modifying the sources.list, but it always seems to skip the USB drive.
June 23rd, 2007 at 5:03 pm
Hi,
I updated the script so that it works for any number of DVDs, and configurable for different architectures and distribution versions. Find it here while it’s hot!
P.S. see this bug if you want to run the script on an Ubuntu Edgy machine, since Edgy’s debmirror is broken. The fix proposed in bug comments works.
October 23rd, 2007 at 3:53 pm
Hello!
This script is very useful, thanks a lot!
Is there a Feisty version of your script? Are there additional repositories to add, because I want to backup everything.
Cheers
January 6th, 2008 at 3:51 am
Sorry I didn’t saw the last comments.
Your’ doing a great job.
Thanks.
January 6th, 2008 at 12:25 pm
After having looked at a number of solutions I’ve put together a tutorial over at UbuntuForums, crediting this site for much of the content. It is updated and maintained regularly. Feel free to visit and, if you’ve got a script to recommend, I’ll add it and credit the writer. I’ve added an FAQ as well as the Canonical Commercial repos and MediBuntu.
February 6th, 2008 at 11:01 am
[…] Credits This tutorial was blatantly ripped off from Burt who admits he borrowed it from Ramon (original tutorial now here — originally designed for Hoary Hedgehog–somewhat out of date). […]
May 20th, 2008 at 3:54 am