1. How to install Ubuntu 20.04 on the same drive with ubuntu 18.04:
Use a separate partition as / (root) ext4 on the same drive:
example sdb4 as / ext4 and sdb5 as /home ext4 for 20.04 and sdb2 as / ext4 and sdb3 as /home ext4.
sdb1 (swap) will be used for both distributions.
UPDATE: I installed also with bootloader and it worked ok. If you install with below ubiquity -b
then when the kernel is updated in the installation that was installed without grub (20.04 in this example), the "old" grub is not updated.
Install 20.04 using live cd -> try ubuntu -> in terminal run command ubiquity -b
to install without boot loader (grub).
Reboot into the old distribution 18.04 and run in terminal sudo update-grub
.
Reboot after the update finishes.
Choose Advanced for 20.04. Then second option from the top.
2. If you happen to have 2 hard drives on your computer:
Install each ubuntu distribution on a separate drive, with its separate swap, root and home partition.
Note UPDATE: for 2nd option and first with boot loader:
When you update the kernel in one of the distributions, the default grup will be the one that was last updated by the kernel update and the default Ubuntu from the top of the GRUB will be also the one that had its kernel updated last.
Example: Given the above situation your grup will have:
Ubuntu
Advanced...
Ubuntu 20.04
Advanced...
...
...
You update the kernel on 20.04 =>
Ubuntu
Advanced...
Ubuntu 18.04
Advanced...
...
...