Saturday, 4 May 2019

installation - Ubuntu restoring applications and settings


I frequently encounter the situation where i change laptop/desktop and when i install Ubuntu i have to install all my applications and restore settings.


Off-late i have been trying to write a bash script which would automate the installation and configuration.


Is there any other better way than writing a script. For e.g. Backup home folder, etc folder.



Answer



If you have everything installed from the standard repositories you can record your package selections with:


sudo apt-get install debconf-utils
sudo dpkg --get-selections '*' > selection.dpkg
sudo debconf-get-selections > selection.debconf

Then you can replicate that package selection on a fresh install with:


sudo debconf-set-selections < myselection.debconf 
sudo dpkg --set-selections < myselection.dpkg
sudo apt-get -u dselect-upgrade.

If you also backup your /etc, /home and other area where you have config or files that don't come from a package, you should be able to clone a machine pretty quickly.


This won't work if you are skipping between releases though, so instead I just keep a manual list of everything I install and all config that I change. If you keep this in an ordered way you can bring a new machine up to spec pretty quick anyway (and as you are doing things "manually" you can skip packages/steps that are no longer relevant so that you aren't carrying more cruft than you need to from one install to the other). I used such a list when I installed Ubuntu on my recent netbook purchase. Obviously you need the backup of /home and /etc as well but you should have good backups already anyway.


No comments:

Post a Comment

How can I VLOOKUP in multiple Excel documents?

I am trying to VLOOKUP reference data with around 400 seperate Excel files. Is it possible to do this in a quick way rather than doing it m...