upgrade EC2 from ubuntu 18.04 to ubuntu 20.04

Shi
CI/CD/DevOps
Published in
3 min readSep 14, 2023

this is quite a horror story for me.

I am trying to install Bazel on Ubuntu, and it prompted me to upgrade my npm, which in turn prompted me to upgrade node.js, and then I happily landed on the below GitHub page:

https://github.com/nodesource/distributions#installation-instructions

oops, the time has finally arrived, and I have to move forward to Ubuntu 20.04 at least.

I am rather a developer than system administrator. And, when I worked on a bare metal machine, I am usually not the one updating the operating system (or I have found excuse to avoid the chore). Now, I am all on my own now as this is my own EC2 …. :(

after some googling, I find something that seems to be working at https://askubuntu.com/questions/717827/can-i-smoothly-upgrade-from-one-lts-to-next-lts-release

The roller coaster ride began,

sudo apt-get install update-manager-core
sudo do-release-upgrade

after a while, pressed the yes/no button many times, I suddenly see the terminal prompted that the system have restarted and my SSH login no longer worked!

I briefly recalled that during upgrade, a separate port 1022 will be opened, and I should probably connect to that instead, but that failed as well.

After staring at the blank screen for a while in shock, I suddenly remembered that I could connect to my EC2 using session manager, and I have setup that previously to get away with annoying firewall on VPN network. Yes, session manager for the rescue, and I am back to terminal again. :)

And, then I realized that the system upgrading has been automatically resumed and running in the background, how do I go back to that screen?
okay, after a while of googling, I found the below,

$ sudo screen -list
There is a screen on:
2953.ubuntu-release-upgrade-screen-window (09/13/2012 04:48:02 AM) (Detached)
1 Socket in /var/run/screen/S-root.

then proceed with

$ sudo screen -d -r root/2953.ubuntu-release-upgrade-screen-window

okay, I see those flushing line comforting me that upgrading work is still running healthily in progress.

and, after a while, I am looking at the below screen,

what the hell!!!!! how to tick those boxes, and I can’t risk to skip this step as this is GRUB and I might break everything.

Finally, after a while of searching, I finally figured out, I just to press spacebar to make the selection.

Okay, finally,

--

--

Shi
CI/CD/DevOps

I am a coder/engineer/application security specialist. I like to play around with language and tools; I have strong interest in efficiency improvement.