1

I would like to have the current system (16.04) manage the upgrade (to 18.04.2) as suggested by the Software Updater. However, I would also like to preserve the content of /home, /opt and /usr/local that, in the current filesystem, are mounted to dedicated partitions.

Keeping /home untouched sounds like a trivial requirement. On the other hand, the other two directories also contain custom installations and links that a user would not want to delete, but I am not so sure whether the Software Updater will format them.

The question here is: will the automatic upgrade procedure only overwrite those filesystem directories strictly needed by the system (/, /boot, /var, /tmp, /etc, etc), and leave the others untouched?

The answer will help me realize the amount of work needed down the line if I take this avenue. I am aware that, alternatively, I could steer the installation manually and preserve those directories.

XavierStuvw
  • 1,451
  • 3
  • 16
  • 45
  • 1
    The do-release-upgrade tool just upgrades packages like dist-upgrade (a little more than that technically; eg. it sets an order) so it doesn't touch user directories. You should of course backup, and ensure you have space. If you want it to be perfect; you can remove unofficial/3rd party packages as these are what create problems (if they use a non-Ubuntu compatible versioning etc). – guiverc Sep 30 '19 at 10:53

2 Answers2

1

The upgrade procedure won't format any partitions.

But it will replace old packages with new ones. You may be asked if you want to preserve old files or replace them.

If you have a lot of customization and non-standard software, there is a great chance that the upgrade won't be smooth; especially the path from 16.04 to 18.04, because of the drastic change in desktop environment from unity to gnome, and lightdm to gdm.

For example, I could never successfully do such an upgrade on my main computer.

Hence, in your case it is highly recommended to do a backup and then do a fresh install of Ubuntu 18.04. Then do your customizations and install all software from scratch.

I know this is a lot of work. That's why I am still using 16.04.

Another way is to do a backup, try to upgrade and see what happens.

Literally answering your question: The partition table will be preserved. There is no such term as "formatting" of directories. If you mean will they be cleared, the answer is negative.

K7AAY
  • 17,202
Pilot6
  • 90,100
  • 91
  • 213
  • 324
  • Backup, then verify the files on the backup match the source files. Backup again, this time to different media (different drive or cloud) and verify again. Then you know your data is safe. – K7AAY Sep 30 '19 at 16:19
  • Verified and answer accepted. Upgrade went smooth. – XavierStuvw Oct 18 '19 at 18:00
0

Many packages support customization within /etc and also your home directory. Then encourage not customizing within /etc but rather within your home. When you do customize withing /etc they can be lost during upgrade but usually you are prompted.

Some packages such as grub leave you no choice as the only place to customize is within /etc/grub/default.

I find upgrading 16.04 to 18.04 takes two or three attempts. I'll get an error message and crash. So I go back to 16.04 cleanup some old files (or remove unused apps) and repeat the process.

I never upgrade on my live system but on a clone:

During the upgrade if you find you are missing files or they get changed you can repeat the cloning, make special copies and repeat the upgrade.

I've also managed to bend the rules and upgrade directly from 16.04 to 19.04 but that came with many challenges:

Even after a successful upgrade I'll still spend weeks testing the new version and like Pilot6's answer after finding deficiencies go back to 16.04 as my daily OS. I still boot the 18.04 or 19.04 cloned upgrades from time to time to experiment when people ask questions on those versions here in Ask Ubuntu.

  • OK but there is no mention of keeping /etc in my question. Actually this directory should not live on a separate partition since some of its content may be required before the partition table is mounted, I understood. – XavierStuvw Oct 18 '19 at 17:59