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.
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.
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
to18.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.