PDA

View Full Version : [ubuntu] updating to new version with fresh install



pbpersson
May 3rd, 2009, 09:51 PM
One of the most upsetting things about updating to a new version through a fresh install is re-adding all the packages. I have 1685 packages installed in Intrepid and re-installing all of them is not an attractive thought.

I know I should just be able to upgrade but if that goes wrong I will be forced into a fresh install.

Is there a way in Synaptic to make a script of all the packages I want to add and then once I am on Jaunty just feed that script into the Jaunty machine to get all my packages installed?

More importantly, has anyone actually done this?

lovinglinux
May 3rd, 2009, 10:59 PM
Simple. Works like magic!

See instructions below:



To replicate your packages selection on another machine (or restore it if re-installing), you can run this:


dpkg --get-selections > ~/my-packages

This will save a file called my-packages in your home directory. Make a backup of it, install the fresh release, then restore the file "my-packages" to new home partition and run this code in the terminal:


sudo dpkg --set-selections < my-packages && sudo apt-get dselect-upgrade

It will download and install all the programs for you, except those that you installed manually, if they are not in the new repository

BTW, I have done this several times.

logos34
May 3rd, 2009, 11:05 PM
See instructions below:


+1

either that or go through synaptic>file>generate pkg download script

lovinglinux
May 3rd, 2009, 11:20 PM
either that or go through synaptic>file>generate pkg download script

That never worked for me, unless the package is not installed and you mark it for installation first, then generate the package.

If you know how to do it, please explain. Just doing synaptic>file>generate pkg download script will create an empty file.

logos34
May 4th, 2009, 02:17 AM
That never worked for me, unless the package is not installed and you mark it for installation first, then generate the package.

If you know how to do it, please explain. Just doing synaptic>file>generate pkg download script will create an empty file.

You're right, I don't know what I was thinking.

I mean, you can select all installed pkgs, mark for 'reinstall', select download script option, then cancel, but that will give a list like this:


#!/bin/sh
wget -c http://us.archive.ubuntu.com/ubuntu/pool/main/b/bash/bash_3.2-0ubuntu18_amd64.deb
wget -c http://us.archive.ubuntu.com/ubuntu/pool/universe/l/linux/linux-image-2.6.24-23-rt_2.6.24-23.52_amd64.deb
wget -c http://us.archive.ubuntu.com/ubuntu/pool/universe/l/linux/linux-image-2.6.24-22-rt_2.6.24-22.45_amd64.deb

...etc

but that's of no use with distribution upgrade/fresh install because you will want the version for the new release.

So it appears that the option is only good for maybe backup or (re)install of same release, on same or diff machine

pbpersson
May 4th, 2009, 03:44 AM
Simple. Works like magic!

See instructions below:

BTW, I have done this several times.

OK, I am trying this right now going from my production Intrepid machine to a test Jaunty machine, all the packages are installing on Jaunty now.

Now.....assuming I have the /home in its own partition with all my preferences, email, and settings, when I am done with the entire operation won't this mean 95% of my packages will also be setup how I want them on the new version of Ubuntu?

lovinglinux
May 4th, 2009, 03:47 AM
OK, I am trying this right now going from my production Intrepid machine to a test Jaunty machine, all the packages are installing on Jaunty now.

Now.....assuming I have the /home in its own partition with all my preferences, email, and settings, when I am done with the entire operation won't this mean 95% of my packages will also be setup how I want them on the new version of Ubuntu?

Yep 8-)

Beautiful, isn't it?

pbpersson
May 4th, 2009, 04:03 AM
Yep 8-)

Beautiful, isn't it?

Ummm.....sort of shocking, really :o

Thank you so much for your help - this is a wonderful way to upgrade! :)