Ubuntu – Reinstalling Ubuntu without formatting /home, as well as without any old config files

formathome-directorysystem-installation

I have /home on a separate partition. I want to reinstall Ubuntu.

I don't want to lose my personal files in /home (I already have a backup but I would like to avoid the hassle of restoring the backup). I know how to reinstall Ubuntu using an existing /home partition without formatting it, but I don't want any configuration from previous Ubuntu to be in the new install.

In other words, I would like a new and fresh install of Ubuntu, with my previous personal files in /home but WITHOUT any configuration file from the previous Ubuntu install. Is this possible? How could I accomplish that?

I was thinking about manually deleting all the hidden configuration files in /home (those starting with a "dot") from the Live CD before starting the installer, but I'm not sure if the file permissions will allow me to delete those files and I'm also not sure if that will be enough to not bring any configuration setting from the previous install. I thought it would be good to ask here before trying to do that, for "safety" reasons 😉

Best Answer

  • I've done this quite often now - almost every time I did upgrade my system or (especially) if I switched to another distro. I normally log out, go to a console and log in as root directly (or depending on system configuration, as another user and switch to root), cd to /home folder and simply change my user's home folder name e.g. to "myUserName.bak". e.g.:

    sudo mv /home/myUserName /home/myUserName.bak
    

    After installation I can safely move all data needed to the newly created home folder for my user. (That's also a good point for thinking whether you e.g. really need that folder of big files you never touched the last 2 years ;) )

    edit as suggested by comments: before you can access the files and folders from your renamed home folder you have to

    sudo chown -R newUser.newUsersGroup /home/myUserName.bak