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,

<p>Code:
dpkg --set-selections &lt; installed-software
followed by</p>

<p>Code:
dselect</p>
Eliah Kagan
  • 117,780
  • Yes: https://help.ubuntu.com/community/ReinstallingSamePackages and: https://askubuntu.com/questions/17823/how-to-list-all-installed-packages – oldfred Apr 06 '18 at 18:38

1 Answers1

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
oldfred
  • 12,100