NOTE: Make sure to disable secure boot from BIOS settings before proceeding. If you don't want to disable Secure Boot, you've to manually sign the kernel. This answer may help.
A few points to note:
The kernel you want to install is 5.16.1
whereas the tutorial you're following shows the method to install 5.16
.
5.16
is a mainline kernel.
Ubuntu uses the latest stable LTS kernel instead of the latest stable kernel.
You should not upgrade your kernel manually unless you want some specific driver support.
As of Jan 20, 2022, there is no easy way to install 5.16.1
except compiling from the source. You can get the Tarball from its official website (direct link). Compiling is easy but installing dependencies and configuring installation is hard. You'll more likely face errors.
Manual kernel installations do not upgrade automatically with apt upgrade
. You need to manually upgrade them each time or use the script mentioned below in this answer.
Fixing the installation issue
It's because of a dependency issue, running a force install will fix it:
sudo apt -f install
Preferably, you can use aptitude
for a better result:
sudo aptitude -f install
Alternative way to install kernel 5.16
Alternatively, running the below commands will also install the kernel v5.16
:
cd ~/Downloads
wget -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.16/amd64/linux-headers-5.16.0-051600_5.16.0-051600.202201092355_all.deb
wget -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.16/amd64/linux-headers-5.16.0-051600-generic_5.16.0-051600.202201092355_amd64.deb
wget -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.16/amd64/linux-image-unsigned-5.16.0-051600-generic_5.16.0-051600.202201092355_amd64.deb
wget -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.16/amd64/linux-modules-5.16.0-051600-generic_5.16.0-051600.202201092355_amd64.deb
sudo dpkg -i *.deb
sudo apt -f install
Installing the latest kernel.
The title says that you want to install the latest kernel, you can use an automated script to install the latest kernel:
Install the shell script which automatically checks and install the latest kernel:
wget https://raw.githubusercontent.com/pimlie/ubuntu-mainline-kernel.sh/master/ubuntu-mainline-kernel.sh
sudo install ubuntu-mainline-kernel.sh /usr/local/bin/
Run the shell script:
sudo ubuntu-mainline-kernel.sh -c
Install the latest stable kernel:
sudo ubuntu-mainline-kernel.sh -i
Press Y to accept the installation.
Reboot to boot into the latest kernel:
sudo reboot
for the future, if you'd like to recheck and reinstall the latest stable kernel, you can simply run:
sudo ubuntu-mainline-kernel.sh -i
Note: You can check the kernel you are using, using the following command:
uname -r