How do I update my GCP vm to the latest version?

I've been running a prototype VM for a year now. I haven't updated it in months. I tried to update it recently using sudo apt update.

However I get the following error:

    Ign:1 http://us-east4.gce.archive.ubuntu.com/ubuntu groovy InRelease
Ign:2 http://us-east4.gce.archive.ubuntu.com/ubuntu groovy-updates InRelease
Ign:3 http://us-east4.gce.archive.ubuntu.com/ubuntu groovy-backports InRelease
Err:4 http://us-east4.gce.archive.ubuntu.com/ubuntu groovy Release
  404  Not Found [IP: 35.196.128.168 80]
Err:5 http://us-east4.gce.archive.ubuntu.com/ubuntu groovy-updates Release
  404  Not Found [IP: 35.196.128.168 80]
Err:6 http://us-east4.gce.archive.ubuntu.com/ubuntu groovy-backports Release
  404  Not Found [IP: 35.196.128.168 80]
Ign:7 http://security.ubuntu.com/ubuntu groovy-security InRelease
Err:8 http://security.ubuntu.com/ubuntu groovy-security Release
  404  Not Found [IP: 91.189.88.142 80]
Reading package lists... Done
E: The repository 'http://us-east4.gce.archive.ubuntu.com/ubuntu groovy Release' no longer has a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://us-east4.gce.archive.ubuntu.com/ubuntu groovy-updates Release' no longer has a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://us-east4.gce.archive.ubuntu.com/ubuntu groovy-backports Release' no longer has a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://security.ubuntu.com/ubuntu groovy-security Release' no longer has a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

My vm is a Google Compute Engine instance.


The Ubuntu distribution you are using seems to be outdated, and when this happens Ubuntu changes the servers of the repositories. To be able to update your distribution, edit /etc/apt/sources.list and change archive.ubuntu.com and security.ubuntu.com, to old-releases.ubuntu.com.

But as mentioned by @ Knud Larsen, 20.10 groovy was moved to old releases old-releases.ubuntu.com/ubuntu, and us-east4.gce.archive.ubuntu.com/ubuntu doesn't work for "old unsupported". Hence, you will not be able to change us-east4.gce.archive.ubuntu.com/ubuntu to old-releases.ubuntu.com. You can try moving the VM to another zone/region and try to update the version.

Steps to upgrade ubuntu version:

  1. Create a backup of your server or vm.
  2. Upgrade all installed packages of Ubuntu version by running sudo apt update && sudo apt upgrade command.
  3. Reboot the Ubuntu Linux system by tying the sudo reboot command.
  4. Install the Ubuntu update tool, run: sudo apt install update-manager-core.
  5. Start the upgrade procedure, run: sudo do-release-upgrade.
  6. Reboot the box, run: sudo reboot.
  7. Verify upgrades.