1. View the kernel
uname -r
We will see the following.
5.15.0-58-generic
This is my current kernel.
2. Download the kernel
Download using wget
command.
wget -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v6.4-rc1/amd64/linux-headers-6.4.0-060400rc1-generic_6.4.0-060400rc1.202305072134_amd64.deb
wget -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v6.4-rc1/amd64/linux-headers-6.4.0-060400rc1_6.4.0-060400rc1.202305072134_all.deb
wget -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v6.4-rc1/amd64/linux-image-unsigned-6.4.0-060400rc1-generic_6.4.0-060400rc1.202305072134_amd64.deb
wget -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v6.4-rc1/amd64/linux-modules-6.4.0-060400rc1-generic_6.4.0-060400rc1.202305072134_amd64.deb
Note that you need to download it according to the chip architecture of your own server CPU
, which I use here x86_64
.
3. Install the kernel
dpkg -i *.deb
After the installation is complete, the system needs to be restarted.
init 6
4. Uninstall the old kernel
Check out the old kernel files first.
dpkg --list | grep linux-image
dpkg --list | grep linux-headers
Unload the kernel.
apt purge linux-image-xxx
apt purge linux-headers-xx
5. Automatically update the kernel
You can optionally enable automatic kernel updates.
Turn on auto-update kernel.
apt-mark unhold linux-image-generic linux-headers-generic
Turn off automatic kernel updates.
apt-mark hold linux-image-generic linux-headers-generic
内核。