If you live in a country with a slow internet connection, have limited bandwidth capacity, have multiple machines or would like to conserve your bandwidth by not doing repeat downloads, this tutorial will be useful to you.

I recently came across a rather simple method for keeping my machines updated with the latest packages by downloading the updates once and then using those packages to update the other machines/PCs.

Here is a checklist before attempting this:

  • All machines should be using the same version of Linux on the same processor-type (eg. Ubuntu 12.04, 32-bit)
  • The machine where you do the initial updates requires SSH to be installed
  • All the machines should be connected via a router/LAN
  • Passwords for all the machines will be required

The steps provided below will be done on Ubuntu machines. Similar commands from other distros should be applied where Ubuntu-commands are used. (paths for the packages may differ though)

Step 1 - Installing SSH:

Getting SSH installed on your main download machine can be done in a single command:

sudo apt-get install openssh-server

If you'd like more info on SSH (maybe for installing on a remote server), click here.

Step 2 - Updating packages for main machine + IP address:

First do your updates on the main machine (either through Terminal or via the Update Manager). Once that is done, you will now (mostly) be doing everything else on your other machines (I will refer to them as "client" machines).

Let's first get the IP address of the main machine. Type this command in Terminal/CLI:

ifconfig

You should be looking for a line like this:

inet addr:192.$$$.$.$ Bcast:192.$$$.$.$$$ Mask:255.$$$.$$$.$

($ = numbers)

After typing the command above, let us use an example IP address of:

192.168.1.102

You need to remember this IP address, as this is what you will use to connect from client machines to your updated/main machine.

Step 3 - Updating client machines:

Take one of your client laptops/desktops (which is connected to the same router as the main machine) and open Terminal/CLI. In the Terminal, type this:

sudo scp kent@192.168.1.102:/var/cache/apt/archives/*.deb /var/cache/apt/archives/

"kent" is the name of the main machine. You need to specify the name you are using on your main machine where "kent" is.

This command is "secure copy" (scp) which transfers the archives of the updated machine to your client machines. You can read from the command how it is copying archives from one folder to another.

You will likely be asked for the passwords of both machines (client and main machine) after using the command above. If everything was successful, you should see a transfer or files being done.

Your client machine should now have the updated .deb files, so let's do the actual update on the client machine. Type this (still in Terminal):

sudo apt-get update

Then:

sudo apt-get upgrade

You should now have all your packages updated.

Note 1: The linux system files don't seem to update after running "sudo apt-get upgrade", but you can update them through the update manager

Note 2: Even if you have different packages on your machines (like extra packages on the main machine), the other packages that weren't previously installed on your client machine will not be installed