K.S. Bhaskar via plug on 15 Apr 2022 14:21:00 -0700


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Upgrading Kubuntu 18.04 -> 22.04


Also, I forgot to mention that you have to upgrade 18.04 to 20.04 to 22.04. So, using the scenario I mentioned, you'd have partition A running 22.04 and partition B running 20.04.

Regards
– Bhaskar

On Fri, Apr 15, 2022 at 5:19 PM K.S. Bhaskar <ksbhaskar@gmail.com> wrote:
We've been running 22.04 for a couple of weeks now, and it has been pretty stable with no surprises or issues. No surprises or issues is what I hope to get from software anyway. On an identical machine an upgrade from 20.04 (with do-release-upgrade -d) failed for some unknown reason, but that was several weeks ago.

This is how I set up & upgrade machines so that when upgrades fail, it's no big deal.

  • A machine has two partitions (apart from EFI, /home, etc.), let's call them A and B.
  • A is the root partition, and B is mounted as /spare.
  • Make A up to date (e.g., apt update && apt upgrade && apt autoremove).
  • Delete the contents of B; rm -rf /spare/*
  • Clone A to B: rsync -auvx / /spare/
  • Upgrade grub: update-grub
  • Edit the os-prober section of /boot/grub/grub.cfg to fix the UUIDs so that all point to the UUID of B and save.
  • Edit to swap the UUIDs and partition/drives of / and /spare and save as /spare/boot/grub.grub.cfg
  • Edit /spare/etc/fstab to swap the UUIDs of / and /spare
  • Reboot (so that B is / and A is /spare; with grub-reboot, I have upgraded machines remotely).
  • Upgrade B from, say, 18.04 to 20.04, or 21.10 to 22.04 or whatever. When the upgrade completes, it updates the bootloader so that B is the root. If the upgrade fails, both A and the bootloader are untouched, so there's nothing to repair.

The reason I don't know why my upgrade from 20.04 to 22.04 failed is that I was doing it overnight remotely using screen. Next morning, the screen session was gone, and the machine was booted into 20.04 on A. I'll try the upgrade again by and by.

Regards
– Bhaskar
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug