To install a new version of Linux, I usually just download the kernel and the initrd from network installer media. I copy it to /boot (new files I rename to something like /boot/newlinux and /boot/newinitrd)
An example how I installed OpenSUSE Leap 15.6 from another Linux: I went to http://download.opensuse.org/distribution/leap/15.6/repo/oss/boot/x86_64/loader/ and downloaded linux and initrd.
I renamed them and moved to /boot:
Then I run Grub, edit current linux loader lines (push E), then I replace /boot/vmlinuz…. with /boot/newlinux and /boot/initrd… with /boot/newinitrd. Then Crtl+X to boot, configure the installation source, network and installation can proceed.
Installation started, now just edit the URL and if DHCP doesn't work, use a static IP address.
Usually I do this with Opensuse Leap, but have done it with Ubuntu also.
If the installer doesn't have internet (needs some special network drivers etc), this method is not so good.
It should be noted that the partitioning should be thought about beforehand. Usually I have /home on a separate partition, then I don't need to format the home partition, only the new / (root) partition.