Thursday, September 21, 2023
 Popular · Latest · Hot · Upcoming
rated 0 times [  4] [ 0]  / answers: 1 / hits: 301  / 9 Months ago, sun, january 15, 2023, 11:52:09

I have two computers on the same WIFI network at home. Both run on Ubuntu 12.04 and both will need to update to 12.10 shortly.

There are some applications that are installed on one but not on the other and vice versa. But they share a large many applications.

Please indicate how can I upgrade both in such a way that:

  • I download all the packages required on Computer 1

  • Move the downloaded packages to the other computer using external HD (that is much quicker than over WIFI)

  • Then upgrade Computer 1

  • Then upgrade Computer 2 -- after it downloads any packages that are not already available.

Also, I am a newbie and would be grateful if the process is simple and properly explained.

More From » 12.04


Upgrade the first computer normally, then copy all of the .deb files that it downloaded to an external drive:

cp -v /var/cache/apt/archives/*.deb /media/pendrive

Next copy all of the .deb file onto the same directory on the second computer:

sudo cp -v /media/pendrive/*.deb /var/cache/apt/archives/

Then upgrade the second computer. Of course, change /media/pendrive/ to the correct path for your deb backup device.

This way, the update will happen on the second computer but it will be able to re-use the .deb files that have already been downloaded without downloading them again. Both computers must be the same release - either 32 or 64 bit.

You can also use this technique to update both systems normally. Set one to update automatically if you wish, and the other one to not check for updates automatically. Periodically copy the updated .deb files to the second computer and run the update. If you keep this library of .deb files then you can also use it after installing a new machine to make the first update very quick - do not let the system do the updates during installation and instead do it manually after installation.

I actually use scripts to maintain the .deb file backups, restore them, and even copy them to a new system while it is being installed. Using cp with the -n switch it doesn't try to copy over items that are already there and is very easy to use and maintain. Here's the one I use to upload the .deb files to the pendrive. Note that the pendrive should have a volume name so that it's mountpoint is always /media/yourname - the script will accept the volume name as an argument eg

debupdate yourname

The script can also keep separate backups for different releases without getting confused - it stores the archives under /media/yourname/archives/kernel where kernel is the major release level (ignoring the -xx extensions). If you're worried about the .deb files being deleted you could run this several times during the update, or maybe automate it to do so.

Here's the script:

#! /bin/bash
#copy the contents of the working archives to the given device
#No files will be overwritten (existing will be skipped)
rel="$(uname -r)"
# For releases with single digit third series, truncate the '-'
if [ "${rel:5:1}" == "-" ]; then
echo "Kernel release level is "$release
if [ -z ${args[0]} ]; then
echo "You must pass the volume name of target"
if [ ! -d "/media/${args[0]}" ]; then
echo "Backup device ${args[0]} not found"
exit 1
mkdir -p /media/${args[0]}/archives/$release/
cp -nv /var/cache/apt/archives/*.deb /media/${args[0]}/archives/$release/

[#35104] Tuesday, January 17, 2023, 9 Months  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.

Total Points: 226
Total Questions: 111
Total Answers: 108

Location: Mexico
Member since Sun, Jul 25, 2021
2 Years ago