How to upgrade Ubuntu to 22.04 and kernel to 5.17
Sergey Sypalo https://www.linkedin.com/in/sergeysypalo Sypalo.com
2019-05-14
In this article, I will show you how to upgrade Ubuntu to 22.04. As a reminder, this is a future release with long term support, but still under development. If you want to upgrade to one of the previous versions, I will also show you how to do it. As a bonus, we will also update kernel to the latest mainline 5.18-rc7 or stable 5.17.8. The latest Ubuntu Jammy 22.04 contains the following improvements:
- Updated installer
- Linux Kernel 5.13
- GNOME 40
- NVIDIA Closed-Source Driver Now Supports Wayland
- Zstd compression for packages
- Firefox Is Now Shipped as a Snap
- The Yaru Light Theme Is Now Default
- Multitouch gestures
- PulseAudio 15 With Bluetooth LDAC Support
- Graphical Applications in Windows Subsystem for Linux

To perform Ubuntu upgrade to 22.04 you will need around 1 hour to follow these steps:
Preparation
-
Update packages listsudo apt-get update
-
Upgrade packagessudo apt-get upgrade
-
Install update-manager-core packagesudo apt-get install update-manager-core
Upgrade Ubuntu
-
Upgrade distrosudo apt-get dist-upgrade
-
Upgrade Ubuntu to the latest LTS release
In short, it only takes one command to upgrade from one LTS (Long Term Support) version of Ubuntu to another. It is also recommended that you upgrade your Ubuntu to the latest LTS version to avoid the hassle of updating packages to a version that is too new from the one currently installed.
If your version is 18.x or lower, run the following command (this step will have to be repeated several times until the Ubuntu version is 20.04):sudo do-release-upgrade -
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 Jammy Jellyfish 22.04. (These are the same steps you need to take when upgrading Ubuntu to a short-term support (odd-numbered) version, as well as a development version like 22.04 now.)
sudo sed -i 's/lts/normal/g' /etc/update-manager/release-upgrades -
Change default distro from your current
- 14.04 - trusty
- 16.04 - xenial
- 18.04 - bionic
- 18.10 - cosmic
- 19.04 - disco
- 19.10 - eoan
- 20.04 - focal
- 20.10 - groovy
- 21.04 - hirsute
- 21.10 - impish
- 22.04 - jammy (development branch)
in the example below, we are upgrading from Ubuntu 20.04 (focal) to 22.04 (jammy)
sudo sed -i 's/focal/jammy/g' /etc/apt/sources.list -
Update packages listsudo apt-get update
-
Upgrade packagessudo apt-get upgrade
-
Run full upgradesudo apt-get dist-upgrade
-
If any error re-runsudo apt-get update
sudo apt-get dist-upgrade -
Run cleanupsudo apt-get autoremove
sudo apt-get clean -
Reboot the systemsudo shutdown -r now
Upgrade kernel
-
Change current directory to /tmpcd /tmp
-
Download kernel
-
Latest mainline from 5.18.х branch
wget -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.18-rc7/amd64/linux-headers-5.18.0-051800rc7_5.18.0-051800rc7.202205160241_all.deb wget -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.18-rc7/amd64/linux-headers-5.18.0-051800rc7-generic_5.18.0-051800rc7.202205160241_amd64.deb wget -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.18-rc7/amd64/linux-image-unsigned-5.18.0-051800rc7-generic_5.18.0-051800rc7.202205160241_amd64.deb wget -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.18-rc7/amd64/linux-modules-5.18.0-051800rc7-generic_5.18.0-051800rc7.202205160241_amd64.deb wget -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.18-rc7/amd64/linux-modules-iwlwifi-5.18.0-051800rc7-generic_5.18.0-051800rc7.202205160241_amd64.deb
-
or latest stable from 5.17.х branch
wget -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.17.8/amd64/linux-headers-5.17.8-051708_5.17.8-051708.202205151940_all.deb wget -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.17.8/amd64/linux-headers-5.17.8-051708-generic_5.17.8-051708.202205151940_amd64.deb wget -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.17.8/amd64/linux-image-unsigned-5.17.8-051708-generic_5.17.8-051708.202205151940_amd64.deb wget -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.17.8/amd64/linux-modules-5.17.8-051708-generic_5.17.8-051708.202205151940_amd64.deb wget -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.17.8/amd64/linux-modules-iwlwifi-5.17.8-051708-generic_5.17.8-051708.202205151940_amd64.deb
-
-
Install new kernelsudo dpkg -i *.deb
-
Reboot the systemsudo shutdown -r now
Finishing up
-
Update packages listsudo apt-get update
-
Upgrade packagessudo apt-get upgrade
-
Reboot the system if neededsudo shutdown -r now
-
Check the OS distrolsb_release -a
-
Check kernel versionuname -r
That's it, now you should be running on the latest best-looking Ubuntu 22.04 and most secure Linux Kernel.