Sunday, September 2, 2018

Ubuntu 18.04 (Bionic Beaver) upgrade failure and recovery

I got Ubuntu's upgrade notification and I started upgrading my installation. For some reason I had to abort the upgrade and shut down the system which led to the corruption of entire installation. Hence, I was not able to boot the installation normally and here are the steps which I had followed to recover the system:

1. Pressing shift button when the system started led to see the boot menu and I had selected one of 
    the old recovery images.
2. sudo dpkg --configure -a
    - installed the package maintainer's version.
3. Upgraded the system from updates gui.
4. There were lots of images so I had to purge the ones which were not required:
    - sudo apt-get purge "linux-image-version_of_the_image_to_remove" (w/o quotes)
    - sudo update-grub2
5. sudo reboot
    - Pressed shift button to show the boot menu -> went to advanced options.
    - The new image and its recovery were listed. This is because of purging the old images as above.