This guide only applies to SSD KVM VPS service.
By default, Ubuntu 16.04 now comes with a kernel version
4.4.0-21-generic . You can manually check the kernel version on the VPS using the following command:
To change another kernel version for Ubuntu 16.04 operating system, you can follow the following instructions.
Find kernel version
First, we will find the kernel version available in the apt package with the following two commands:
sudo apt-get update apt-cache search --names-only linux-image
A list of kernel versions will appear, you just need to find the version you need to install and change the version number in the installation command below:
sudo apt-get install linux-image-4.4.0-75-generic linux-headers-4.4.0-75-generic
If the system asks you to create the file
/boot/grub/menu.lst , please choose
For kernel version not in library
If you need to install a kernel version that is unavailable in the library, find the kernel version at http://kernel.ubuntu.com/~kernel-ppa/mainline/. You choose the folder for the version you want to download and download the two files
all for amd64. For example:
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.9.24/linux-headers-4.9.24-040924-generic_4.9.24-040924.201704210431_amd64.deb wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.9.24/linux-image-4.9.24-040924-generic_4.9.24-040924.201704210431_amd64.deb wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.9.24/linux-headers-4.9.24-040924_4.9.24-040924.201704210431_all.deb
Then install all the downloaded files:
sudo dpkg -i *.deb
Now you can follow the steps below to finish.
Set kernel version at boot
GRUB_DEFAULT=0 and change to
GRUB_DEFAULT=saved . Then add the following 2 sentences below:
Then recreate the
export GRUB_CONFIG=sudo find /boot -name "grub.cfg"
And rebuild this file:
Next, we will use the following command to display the list of installed kernel versions:
grep 'menuentry ' $GRUB_CONFIG | cut -f 2 -d "'" | nl -v 0
Now, if you need to use which kernel version, you just need to use the grub-set-default command to set it up. For example, if you want to use the kernel version with the ordinal number 0, use the command:
Note that we do not use recovery mode versions.
And reboot the VPS.
After the VPS reboot is complete, log in to VPS again and check the kernel version with the