1

I'm writing a script to execute after a new installation of Minimal Ubuntu(mini.iso) to install all the software I need and sync the dotfiles I backed up previously.

What's the best way to avoid errors? Install the software and after do the sync of the dotfiles within my /home folder or the contrary?

Thanks!

2 Answers 2

1

I have been doing the opposite, I install the OS then install packages using APT / snapd then copy dotfiles.

Try it first on a VM to check what might break when installing a newer OS (or newer package versions) and re-using your existing dotfiles. Sometimes the conf file syntax may have changed, but then I would look for ways to avoid this hassle in the future. usually there is some folder.d/ directory where users may place override settings that will not be overwritten and easy to see what's changed from the default.

I know you didn't explicitly ask about it, but in case you don't know git is a great way to manage dotfiles. I use yadm myself - it's just like normal git commands.

1

I always had the /home folder and the system files on seperate partitions on my hard disk. Whenever I reinstalled the system the /home folder was left untouched and in the installation procedure I simply used the /home partition for the /home mount point (without formatting). The newly installed systems never had any problems.

So, this scenario would correspond to: "Copy dotfiles first, then install software".

My intuition is that most newly installed programs would first look wheter a given configuration directory ("dotfile") exists. In case they do the software would load configuration data frome there. In case they do not the software would create the dotfiles an initialize default configuration values.

1
  • That's my intuition too. I'm about to test it on a VM. After I came back here to tell the results. Thanks!
    – FabioB
    Apr 24, 2020 at 4:23

Not the answer you're looking for? Browse other questions tagged .