| Andrew Stacey | |||
|
|
Wed, 6th Dec 2006 (HowDidIDoThat :: Ubuntu :: Edgy) Updating Ubuntu Offline I have two machines running Ubuntu. One runs Edgy but is not connected to
the internet. The other runs Dapper and has a fast connection. So to keep
the Edgy one up to date I want to download the software on the Dapper machine
and transfer it; but I want this to be as easy as possible so I want to use
the There is a new option in the Synaptic Package Manager that makes the day-to-day part of this very simple. Under the File menu are two options:
The problem with the above solution is telling the Synaptic Package Manager about the packages in the first place, as well as telling it about updates and upgrades. This information is stored on the internet and so is unavailable to the Edgy machine. As yet, the Synaptic Package Manager doesn't have an offline option to update itself so this has to be done by hand. Fortunately, it's fairly straightforward. There are probably several ways of doing this. My approach is based on the fact that I don't understand how the various programs that maintain the system on my machines fit together and interact so rather than trying to mess about with them I would rather just feed them misleading information and let them deal with it how they like. So what I do is set up a mini-mirror of the Ubuntu repositories on my Edgy machine and tell the Synaptic Package Manager to get its information from that. I then keep this mini-mirror up to date via the Dapper machine and everything runs as it should. It does mean the addition of one step in the above process, but it is an easy one. By mini-mirror what I mean is that I mirror the information about the packages in the repositories, but not the packages themselves. The first thing to do is decide which repositories to use. A Ubuntu machine connected to the internet will use several mirrors; the policy seems to be that potentially high risk situations require the main mirrors but other stuff should distribute the load and use a regional mirror. The risks are considerably lessened for a machine offline and so it is possible to use just one mirror. This also simplifies matters a little. I use the following repositories:
wget -xi edgy-resources
This creates a directory gb.archive.ubuntu.com. The next step is to transfer this to the Edgy machine. I put it in /usr/local/share/ubuntu but anywhere sensible would do. The final step is to tell the Synaptic Package Manager where to get its information about packages. This is done by editing the file /etc/apt/sources.list. My version of it can be found in sources.list. It should be obvious how to modify it if necessary.
To keep the Synaptic Package Manager up to date, all that is needed to do is
to keep hold of the file edgy_resources (or whatever you've called
it) and run One extra step is needed when downloading the actual packages. The script generated by the Synaptic Package Manager will look for the packages in /usr/local/share/ubuntu/.... Thus this script needs to be altered to look in the right places. With my set-up, the following perl script does this just fine.
perl -i.orig -pe 's%file:///usr/local/share/ubuntu/%http://%;' edgy_downloads
There is a potential problem in this method if the packages on the mirror get updated between downloading the information and downloading the packages. However, the mirrors appear to keep a couple of older versions so there should still be a package to download. If not, wget will complain and you can manually download that package. Resources
[Full link] |
||