What's The Point Of This Tutorial?
A local set of repositories proves useful for friends and family who have slow or no bandwidth. Assembled from various sources (see the references below) these steps should create Ubuntu repository DVDs to share or keep in storage, however the need arises.
What level experience do you need?
I've tried to conform to the tutorial rules. However, the very nature of this tutorial requires a bit more thinking than simply copying and pasting. Feel free to post a question about some step that may not work right for you. But the idea is to reduce the amount of text in the tutorial within reason by not detailing each step.
Open a terminal (from the top-left side of the Ubuntu screen: Applications → Accessories → Terminal). Please do not close this application throughout the length of this tutorial. Copy the following code and paste it into the terminal.
$ sudo apt-get install debmirror ruby genisoimage dpkg-dev jigdo-file
Hit the Enter key after pasting. (A quick way to “paste” text into the terminal is to hold down the following keys Ctrl+Shift+V, or right click in the terminal and click Paste in the context menu.) While debpartial is still in the repositories (big fancy phrase that means: this is an official and valid Ubuntu file), starting with Hardy Heron, it is not considered part of Hardy Heron or newer – it is 100% compatible. Provided below is the link to the necessary software:
$ wget -c http://archive.ubuntu.com/ubuntu/pool/universe/d/debpartial/debpartial_0+20030508-0.1_all.deb $ sudo dpkg -i debpartial_0+20030508-0.1_all.deb
The debcopy file is included in debpartial (downloaded and installed in Step 1). Let's extract it now for later use. Please paste the following code into the Terminal: cp /usr/share/doc/debpartial/examples/debcopy.gz ~ gunzip ~/debcopy.gz
Use this code to start downloading Lucid Lynx's repository files:
$ debmirror --nosource -m --passive --host=archive.ubuntu.com --root=ubuntu/ --method=ftp --progress --dist=lucid --section=main,restricted,universe,multiverse --arch=i386 ~/UbuntuRepos --ignore-release-gpg
To see the whole code with some brief explanations:
debmirror \ --nosource -m --passive \ --host=archive.ubuntu.com \ (select a faster repository if need be) --root=ubuntu/ --method=ftp --progress \ (ftp can be changed to http) --dist=lucid \ --section=main,restricted,universe,multiverse \ --arch=i386 ~/UbuntuRepos \ (this puts our files in /home/USER/UbuntuRepos) --ignore-release-gpg
Some variables in blue.
Want a detailed explanation of this command? CLICK HERE. (links to a post in this thread.) Be forewarned: this can take a long time, perhaps 24 or so hours. Downloading individual files is slow.
Did the download stop midway? Press the up cursor key on your keyboard and the command should re-appear. Hit Enter and the download will pick up where it last left off.
Regular network glitches? Try adding one of the following argument(s) to the command (the number following “-t” is the length of time – in seconds – before the retry begins) : –timeout=seconds -t 120
The “120” means 120 seconds or 2 minutes. Increase it to 4 minutes, for example, like this: –timeout=seconds -t 240
Part 1: Note: If you changed repositories in Step 3 then the following command will require editing:
$ debpartial --nosource --dirprefix=ubuntu --section=main,restricted,universe,multiverse --dist=lucid --arch=i386 --size=DVD ~/UbuntuRepos ~/UbuntuDVDs
1. Replace the red lucid in the code above with your repository choice (i.e., intrepid, jaunty or karmic). 2. If you plan on burning CDs instead of DVDs, then replace –size=DVD with –size=CD74 (for 650 megabyte CD-Rs), or –size=CD80 (for 700 megabyte CD-Rs)
Part 2: How many CDs will we need to create? How do we find out? Paste this code in the Terminal and hit Enter:
$ ls -l ~/UbuntuDVDs
If the last folder is ubuntu3 you need to create 4 DVDs. If the last folder is ubuntu4 then it will be 5 DVDs, and if the last folder is ubuntu31, you'll need to create 32 CDs, and so on.
Having determined the number of physical discs you'll need, use the following as your pattern until all discs are complete (the only change from one to the next is the final number). These represent Lucid Lynx's requirements:
$ ruby debcopy -l ~/UbuntuRepos ~/UbuntuDVDs/ubuntu0 $ ruby debcopy -l ~/UbuntuRepos ~/UbuntuDVDs/ubuntu1 $ ruby debcopy -l ~/UbuntuRepos ~/UbuntuDVDs/ubuntu2 $ ruby debcopy -l ~/UbuntuRepos ~/UbuntuDVDs/ubuntu3 $ ruby debcopy -l ~/UbuntuRepos ~/UbuntuDVDs/ubuntu4 $ ruby debcopy -l ~/UbuntuRepos ~/UbuntuDVDs/ubuntu5 $ ruby debcopy -l ~/UbuntuRepos ~/UbuntuDVDs/ubuntu6 $ ruby debcopy -l ~/UbuntuRepos ~/UbuntuDVDs/ubuntu7
These instructions assume you've got enough data to make 8 DVDs. If you've downloaded repositories that do not need an 8th DVD, none will be created.
$ mkisofs -f -J -r -V "Ubuntu 10.04 1/8" -o ubuntu-10.04-$(date -I)-complete-i386-dvd1.iso ~/UbuntuDVDs/ubuntu0 $ mkisofs -f -J -r -V "Ubuntu 10.04 2/8" -o ubuntu-10.04-$(date -I)-complete-i386-dvd2.iso ~/UbuntuDVDs/ubuntu1 $ mkisofs -f -J -r -V "Ubuntu 10.04 3/8" -o ubuntu-10.04-$(date -I)-complete-i386-dvd3.iso ~/UbuntuDVDs/ubuntu2 $ mkisofs -f -J -r -V "Ubuntu 10.04 4/8" -o ubuntu-10.04-$(date -I)-complete-i386-dvd4.iso ~/UbuntuDVDs/ubuntu3 $ mkisofs -f -J -r -V "Ubuntu 10.04 5/8" -o ubuntu-10.04-$(date -I)-complete-i386-dvd5.iso ~/UbuntuDVDs/ubuntu4 $ mkisofs -f -J -r -V "Ubuntu 10.04 6/8" -o ubuntu-10.04-$(date -I)-complete-i386-dvd6.iso ~/UbuntuDVDs/ubuntu5 $ mkisofs -f -J -r -V "Ubuntu 10.04 7/8" -o ubuntu-10.04-$(date -I)-complete-i386-dvd7.iso ~/UbuntuDVDs/ubuntu6 $ mkisofs -f -J -r -V "Ubuntu 10.04 8/8" -o ubuntu-10.04-$(date -I)-complete-i386-dvd8.iso ~/UbuntuDVDs/ubuntu7
Note: If you changed repositories in Step 3 then each command above will require editing. Replace the version number of 10.04 with:
9.04 for jaunty and 9.10 for karmic, 10.10 for Maverick i386 for amd64, powerpc or sparc
If you're committed to creating CD-R ISOs (detailed in Step 4) then make the following changes:
replace -dvd1.iso with -cd1.iso
replace -dvd2.iso with -cd2.iso (and so on until all 50 or so CD-R ISOs are completed)
$ jigdo-file make-template --force -j ubuntu-$CODENAME-repository-$ARCH-$i-contrib.template -j ubuntu-$CODENAME-repository-$ARCH-$i-contrib.jigdo -i ubuntu-$CODENAME-repository-$ARCH-$i-contrib.iso -c jigdo-cache.db --label Debian=$SOURCE --uri Debian=$HOST --servers-section $SOURCE
$ md5sum *.iso > MD5SUM.txt $ md5sum *.jigdo > MD5SUM-jigdo.txt $ md5sum *.template > MD5SUM-template.txt
Using Ubuntu (Link) Insert a blank CD into your burner. A “CD/DVD Creator” or “Choose Disc Type” window will pop up. Close this, as we will not be using it. Browse to the created ISO image in the file browser Right click on the ISO image file and choose Write to Disc. Select the write speed. It is recommended that you write at the lowest possible speed. Start the burning process and repeat these steps until all ISOs are done.
There are two ways to add a DVD/CD to your repository list: “KPackageKit” and “Adept”
Kubuntu's built-in package managers seem to have difficulties with adding CD/DVD ROMs to the list of available system packages. Try using the “Terminal” solution.
Synaptic: Open Synaptic Package Manager (System → Administration → Synaptic Package Manager). Enter your password. From the menu: Edit → Add CD-ROM…. and follow the clearly written instructions in each dialog box. Repeat until all your media (DVDs, CDs) have been entered. Should this fail, try the following. Terminal: Open a Terminal (Applications → Accessories → Terminal) and enter the following command: sudo apt-cdrom add Insert the first disc and follow the instructions (it will ask you to name each disc). When apt-cdrom is finished with the disc, eject it with
eject yeah, just type it in and hit Enter) and insert the next and use the same command. Repeat the process per disc. Once the last disc is done, enter this code in the Terminal: sudo apt-get update followed by sudo apt-get upgrade
Which will update your system if any newer files are available. You can now open Synaptic Package Manager to use tens of thousands of packages. (To be added: how to remove previously added DVD/CD entries in apt when old discs are replaced with new, as well as correcting any goofs that occur when incorrectly labeling the discs, etc.)
Now that you have gigabytes of .deb files all tucked neatly into the ~/UbuntuRepos folder… what on earth do you do to keep it updated? Start again? Sort of. Read on…
Open the Terminal (Applications → Accessories → Terminal) and go to the folder where you initially ran debmirror (by default: your home folder) and run the command in Step 3 again. This only makes an incremental update consuming roughly 10 minutes instead of 25 hours. Run this daily and ISO creation won't have the added bore of a long download.
If new DVDs are required or desired, delete your original .iso files (in your home folder) and run steps 5 through 7 to recreate them.
Head over to this link and select the corresponding Ubuntu suite you desire. The difference between the Ubuntu setup CD and the Ubuntu setup DVD is how much of the repositories are on the setup disc. The DVD contains quite a bit more, most of “Main” if I'm not mistaken. However, if you have the repository DVDs handy, a setup DVD is redundant and not recommended. Save your bandwidth and don't bother. However, if you want a snazzy setup DVD, try this on for size: