SiteHost

Upgrading Ubuntu 18.04 to 20.04

Introduction

When considering in-place dist-upgrades, it's crucial to be aware of potential compatibility challenges. Specifically, with the introduction of compressed kernels in Ubuntu 20.04 and kernel version 5.x, certain considerations need to be addressed. Previously, our systems utilized a virtualization mode that does not support compressed kernels. As a result, performing in-place dist-upgrades may lead to compatibility issues in certain environments.

Addressing Compatibility: Adding the Decompression Hook

To address compatibility challenges associated with in-place dist-upgrades, we have developed a solution involving the addition of a decompression hook to existing servers. Follow the steps below to successfully upgrade to Ubuntu 20.04:

  1. Grab the appropriate decompression hook and the extract-vmlinux file required for the process.
  2. Copy the files to their appropriate folders, ensuring the owner and group are set to root and grant execution permissions:
    chmod +x /etc/kernel/postinst.d/kernel-decompress-hook
    chmod +x /usr/local/bin/extract-vmlinux
  3. Perform a system update to ensure everything is up to date:
    apt update && apt upgrade
  4. Install binutils package necessary for the decompression script:
    apt install binutils
  5. Install the required package before performing a distribution upgrade:
    apt install ubuntu-release-upgrader-core
    do-release-upgrade

    Your server page will continue to display Ubuntu 18.04 as the operating system.

Boot failure after upgrading to 20.04:

If you have upgraded your Ubuntu distribution without adding the decompression hook and are now facing a boot failure, you can use the following steps to recover your system:

  1. Start by enabling Resue Mode on your VPS.
  2. Follow steps 1 to 3 from the instructions above.
  3. To trigger the decompress hook, reinstall the most recent kernel version:
    # dpkg --list | grep linux-image
    ii  linux-image-4.15.0-212-generic        4.15.0-212.223                    amd64        Signed kernel image generic
    ii  linux-image-5.4.0-150-generic         5.4.0-150.167                     amd64        Signed kernel image generic
    ii  linux-image-generic                   5.4.0.150.148                     amd64        Generic Linux kernel image
    ii  linux-image-virtual                   5.4.0.150.148                     amd64        Virtual Linux kernel image
    # apt install --reinstall linux-image-5.4.0-150-generic
  4. Leave rescue mode and check if you can access the server through SSH or Console tab in the control panel.