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.

Kommentare

27 responses from my original Wordpress blog

  1. Josh Stegmaier Says:

    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!

  2. John Assael Says:

    Would it be possible to get one copy of the dvds?
    And pay for it…

  3. Burt Says:

    @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

  4. Ryan Says:

    TheLinuxStore.ca carries them. They also include some migration software, Progression Desktop, for free.

  5. How-To Make Ubuntu DVDs Including Main, the Universe and Everything « Bloggitation Says:

    […] read more | digg story […]

  6. shabo blog » Blog Archive » How-To Make Ubuntu DVDs Including Main, the Universe and Everything Says:

    […] 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 […]

  7. Peter Keller Says:

    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.

  8. roger Says:

    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

  9. David Says:

    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′.

  10. Vinicius Depizzol Says:

    This can be easier using AptOnCD application.

    APTonCD is a tool with a graphical interface which allows you to create one or more CDs or DVDs (you choose the type of media) with all of the packages you’ve downloaded via APT-GET or APTITUDE, creating a removable repository that you can use on other computers.

  11. nicolas Says:

    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.

  12. Burt Says:

    Thanks Nicolas, I added the check for mkisofs.

    Burt

  13. Chris Says:

    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!

  14. Lee Wossum Says:

    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?

  15. Lee Wossum Says:

    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.

  16. BobSongs Says:

    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!

  17. glin Says:

    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.

  18. BobSongs Says:

    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

  19. TerraBit Says:

    yo any way of doing this from windows?

  20. ShanDale Says:

    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…

  21. Dave Says:

    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.

  22. Neilen Marais Says:

    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.

  23. Vitamineb Says:

    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 :)

  24. Vitamineb Says:

    Sorry I didn’t saw the last comments.

    Your’ doing a great job.

    Thanks.

  25. BobSongs Says:

    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.

  26. Making your own Ubuntu Repository (BobSongs,etc) « Creative Open Source Says:

    […] 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). […]

  27. Making your own Ubuntu Repository (BobSongs,etc) - OpenSplatt Says:

    […] 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). […]

Kommentar hinzufügen

  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <pre>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen

CAPTCHA
Diese Frage dient dazu festzustellen, ob Sie ein Mensch sind und um automatisierte SPAM-Beiträge zu verhindern.
2 + 1 =
Lösen Sie dieses einfache mathematische Problem und geben Sie das Ergebnis ein. Für 1 + 3 geben Sie z.B. 4 ein.
Inhalt abgleichen