I find this tremendously useful to have my own repositories on a local drive, as I do most of my development offline or in a place where there’s no Internet. Also, it speeds downloads faster. But it’s very cool to say to people that you have 26,000 programs on a disk that pops in your pockets.
These are all the tools necessary (probably too many but some are there to create DVD based respoitories)…
In a terminal copy/paste this…
sudo apt-get install debmirror liblockfile-simple-perl liblog-agent-perl ruby mkisofs dpkg-dev libdigest-sha1-perl libruby libzlib-ruby
Now you need to find a mirror that ain’t gonna bust ya download limit – cos it will – cos these download are huge! Unless ya got unlimited then who cares. But many larger ISPs will have their own free download server. And many times it’ll have a Linux folder. I’m with iinet and I did a search on Google… “iinet ftp” – this’ll bring up a result with “Index of /” – BINGO!
Click it – click the pub folder – see if there’s a ubuntu folder – click on that – then if you see a list of folders with dist indices pool project …. then BINGO! … again.
So the host is ftp.iinet.net.au/pub/
and the root is ubuntu/ … this’ll make sense in a tick. You need to find your own free download server from your ISP.
I prefer a USB Hard drive cos for $80 u can get 500GBs. Reformat it to ext3 (ext4 is better but older distros can’t use ext4) using gparted. And now you’ve got a large blank Hard drive ready.
Make sure that’s it’s mounted before starting the next step. See what the path is to the USB Hard Drive by looking in your File Manager – mine’s /media/disk
Using my ISP free Server…
In a terminal copy/paste this:
debmirror –source -m –passive –host=ftp.iinet.net.au/pub/ –root=ubuntu/ –method=http –progress –dist=lucid,lucid-security,lucid-updates,lucid-backports,lucid-proposed –section=main,restricted,universe,multiverse –arch=i386 /media/disk/Lucid/LucidRepos –ignore-release-gpg –timeout=seconds -t 240
This is a 80GBs download!
arch means the type of versions: eg: i386 is the normal 32bit version – yo can change that to amd64 for amd 64bit processors.
Occasionally it will timeout due to a server reset/update or something similar. Just restart the download and it will restart where it last left off.
Warning: If you accidentally mistype the destination (eg: /media/disk/Lucid/LucidRepos) it’ll wipe all that directory. I’ll give an example that I was stupid enough to do. I was getting a smaller PPA repository and the destination was /home/martin/hardy/PPA; I forgot to finish that line as I went back to make another correction and I had only typed /home/martin. That wiped my entire home folder – clever! Luckily I had a backup from the previous day.
Your ISP may not have uploaded the latest security update from Ubuntu so once the download has finished check your repository with this:
copy/paste into a Terminal:
debmirror –source -m –passive –host=au.archive.ubuntu.com/ –root=ubuntu/ –method=http –progress –dist=lucid,lucid-security,lucid-updates,lucid-backports,lucid-proposed –section=main,restricted,universe,multiverse –arch=i386 /media/disk/Lucid/LucidRepos –ignore-release-gpg –timeout=seconds -t 240
This is the official Ubuntu Server. To keep this up-to-date I update my mirror every 2 weeks using the official server. Probably a 1-2gb download.
How to point to the local drive instead of online:
In a terminal copy/paste this:
sudo gedit /etc/apt/sources.list
everything that points to the archive.ubuntu.com server needs to be changed from http://au.archive.ubuntu.com/ubuntu/ to file:///media/disk/Lucid/LucidRepos (don’t change anything else on that line and remember that the desitination make be named differently) – save and close
In Terminal type:
sudo apt-get update
Any error means that you’ve pointed it wrong to the wrong place.
I will copy and example of my source.list file in the comments section.
Next I will show you all the extra repositories you can accumulate.
PS: If you don’t want the source code where it says –source change that to –nosource (smaller download)