How to upgrade Ubuntu to 21.04 and kernel to 5.14

Sypalo.com

How to upgrade Ubuntu to 21.04 and kernel to 5.14

In this article, I will show you how to upgrade Ubuntu to 21.04 (latest) or 20.04 (LTS). As a bonus, we will also update the kernel to the latest release-candidate 5.15-rc2 or latest stable 5.14.7. The latest greatest Ubuntu Hirsute 21.04 contains the following improvements:

  • WireGuard Support
  • New processor cooling driver
  • USB4 support
  • Amazon Echo Support
  • Improved hardware support
  • VirtualBox Folder Sharing
  • F2FS data compression using LZO/LZ4

And here is a short list of what's new in Ubuntu 20.04:

  • Best and fastest GNOME 3.36 desktop with dark theme support
  • Improved support for 4K monitors and zoom
  • New themes and visual settings
  • Quick install, fast boot
  • Global do not disturb
  • Best Thunderbolt Support
  • Best support for nVidia graphics cards
Before we start I want to let you know that DigitalOcean gives you $100 for free to try their services. You can run VMs or containers, deploy websites and do a lot of cool stuff, including checking how smooth the Ubuntu do 21.04 upgrade will go.
Digital Ocean services

To perform Ubuntu upgrade to 21.04/20.10/20.04 you will need 2 hours to follow these steps:

Preparation

  1. Update packages list
    sudo apt-get update
  2. Upgrade packages
    sudo apt-get upgrade
  3. Install update-manager-core package
    sudo apt-get install update-manager-core

Upgrade Ubuntu

  1. Upgrade distro
    sudo apt-get dist-upgrade
  2. Upgrade Ubuntu to the latest LTS release

    It's recommended to upgrade your Ubuntu to the latest LTS (long term supported) release to avoid any issues with packages upgrade jumping on too new release compared to currently installed one.
    If you have 18.x or lower release please run the next command

    sudo do-release-upgrade
  3. Change default branch from lts to normal

    Otherwise, if you are already on 20.04 and an experienced Linux user, you can skip this step and go straight to upgrading Ubuntu to Hirsute Hippo 21.04

    sudo sed -i 's/lts/normal/g' /etc/update-manager/release-upgrades
  4. Change default distro from your current

    18.04 - bionic
    18.10 - cosmic
    19.04 - disco
    19.10 - eoan
    20.04 - focal
    20.10 - groovy
    21.04 - hirsute
    21.10 - impish (in development)
    in the example below, we are upgrading from Ubuntu 20.04 (focal) to 21.04 (hirsute)

    sudo sed -i 's/focal/hirsute/g' /etc/apt/sources.list
  5. Update packages list
    sudo apt-get update
  6. Upgrade packages
    sudo apt-get upgrade
  7. Run full upgrade
    sudo apt-get dist-upgrade
  8. If any error re-run
    sudo apt-get update
    sudo apt-get dist-upgrade
  9. Run cleanup
    sudo apt-get autoremove
    sudo apt-get clean
  10. Reboot the system
    sudo shutdown -r now

Upgrade kernel

  1. Change current directory to /tmp
    cd /tmp
  2. Download kernel
  3. Install new kernel
    sudo dpkg -i *.deb
  4. Reboot the system
    sudo shutdown -r now

Finishing up

  1. Update packages list
    sudo apt-get update
  2. Upgrade packages
    sudo apt-get upgrade
  3. Reboot the system if needed
    sudo shutdown -r now
  4. Check the OS distro
    lsb_release -a
  5. Check kernel version
    uname -r

That's it, now you should be running on the latest best-looking Ubuntu 21.04 and most secure Linux Kernel.