I did the default install for 20.04 and now I want to install 22.04 can I do so without losing any personal files?
1 Answers
You can upgrade using sudo do-release-upgrade
. This is the safest option and will upgrade your system to 22.04 without losing files or installed apps*. (https://manpages.ubuntu.com/manpages/focal/man8/do-release-upgrade.8.html)
If you want to be able to format/reinstall your system without losing /home data, use this option on setup (https://help.ubuntu.com/community/UbuntuReinstallation), move your /home to a new partition (guide at the bottom of the answer) or you'll have to format everything (so do a backup of your /home folder) and follow these:
- When backup is done and Live USB is done, select live session
- Open gparted or your choice of partitioning tool
- Select your system drive
- Create a new partition table (GPT)
- Create a partition for your /home folder, any size you want (but be sure to give it a size that fulfills your needs
- Open Setup
- When choosing disks, select your system drive
- Edit the partition you created for your /home and in the Mount Point option, select or write /home
- On the remaining (system) partition, on Mount Point select /
- Install
This way your home partition will be separate from your system and reinstalls won't mess with it (remember if you reinstall/format your system to deselect Format Partition for your /home partition on setup). But this approach comes without any cryptography, your /home partition and data would be available to any system, and I'm not sure if Ubuntu's crypto setup supports selective partition encryption. Personally, I use encryption but the only separate partition is /boot because the kernel needs to be accessible for the CPU at boot time.
I have used default install, partitioned install (separate /home folder) & am currently using encrypted install, so most of this answer is from personal experience.
*some libs and maybe apps may be reinstalled/removed during upgrade, this is normal since some apps may have migrated to snap or some libs are no longer required/used. Good news is everything that happens will be reported by your upgrade manager so you'll know what changed.
If you want to move your /home to a new partition after installing, follow this guide: https://www.howtogeek.com/116742/how-to-create-a-separate-home-partition-after-installing-ubuntu/ or this guide: https://help.ubuntu.com/community/Partitioning/Home/Moving

- 73
/home
partition if it is separate from/
, or don't format/
. As simple as that. – Pilot6 May 05 '22 at 13:29