0

I would like to update an Ubuntu installation from 32 to 64 bit. I'd also like to save most of the configurations, especially the installed packages because I have added and deleted quite a big number of them.

So the basic idea is to backup the /etc, /var, and /home directories (actually these are two separate partitions, so I suppose that I could simply not format them), make a fresh installation, and reinstall the old packages. Then copy the relevant /etc/directories from the older installations.

What I am trying to find is how to automate the package reinstall, and if it's possible, to automate the /etc restore.

Are the instruction found in this answer still valid? https://ubuntuforums.org/showthread.php?t=261366

I found out how to do this recently and thought it might be helpful to >some people. To output this information to a file in your home directory >you would use,

Code: dpkg --get-selections > installed-software And if you wanted to use the list to reinstall this software on a fresh ubuntu setup,

Code: dpkg --set-selections < installed-software followed by

Code: dselect

1

I have had issue and had to add dselect and run it.

From old install

dpkg --get-selections > ~/my-packages
From New install
sudo dpkg --set-selections < my-packages
sudo apt-get -y update
sudo apt-get dselect-upgrade

IF you get this error: dpkg: warning: package not in database

sudo apt-get install dselect
sudo dselect 
   -> Update
   -> Install

I include these also:

cp /etc/apt/sources.list ~/sources.list.backup
sudo cp -r /etc/apt/sources.list.d /Like-a-FlashDrive
apt-key exportall > ~/repositories.key
sudo apt-key exportall > /Like-a-FlashDrive/repositories.key

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.