The first factor we wish to try and do before we tend to upgrade the kernel is to update the Ubuntu repositories and to upgrade all packages to their latest versions.
Connect to your ubuntu server through AN SSH login. you have got to be a root user for ensuing steps. If root login is disabled on your server, then login as your traditional user and run 'sudo -s to become root.
Update all repositories of the system.
sudo apt update Then upgrade all packages installed with the command below.
sudo apt upgrade -y
Finally, reboot the server to ensure that potentially installed kernel updates get applied.
sudo reboot
Now check again for upgradable packages with the command below.
sudo apt list --upgradeable
Make sure you have no pensing updates.
Step 2 - Checking the Active Kernel Version
In this step, we are going to check the active kernel of our system. we'd like to grasp the system design and therefore the kernel version that's used on the system.
Check the active kernel utilized by the system with the uname command.
uname -msr
You will get the kernel version as below.
Linux 4.4.0-78-generic x86_64
This means, we are using the Generic Linux kernel version 4.4 with x86_64/64-bit system.
The Generic kernel is a general purpose kernel. If you want to use your box for tasks like editing, encoding video and audio, it's e.g. recommended to use one of the 'lowlatency' kernels.
Step 3 - Install New Kernel Version
Now we all know that we tend to area unit mistreatment kernel four.4 at the instant. during this step, we are going to upgrade the used kernel to the newest inject kernel build version four.11.2. All inject kernel build are often downloaded from this website - http://kernel.ubuntu.com/~kernel-ppa/mainline/.
Create a new directory for the mainline kernel version.
sudo mkdir -p ~/4.11.2
cd ~/4.11.2Download the generic kernel version packages (because we are using generic version) using the wget command.
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.11.2/linux-headers-4.11.2-041102_4.11.2-041102.201705201036_all.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.11.2/linux-headers-4.11.2-041102-generic_4.11.2-041102.201705201036_amd64.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.11.2/linux-image-4.11.2-041102-generic_4.11.2-041102.201705201036_amd64.deb
Now install the packages with the dpkg command below.
dpkg -i *.deb
When the kernel package installation is complete, update grub and reboot the system.
sudo update-grub
sudo reboot
After server rebooting, check again the kernel version.
uname -msr
You will get a new kernel on the system: 4.11.2.
Linux 4.11.2-041102-generic x86_64
Step 4 - Remove the old Kernel
At this stage, the kernel version of our server is updated to four.11.2. during this step, square measure going to} take away the recent kernel and simply leave the restructure that we tend to are victimisation currently.
For this purpose, we are going to use a command-line utility named 'byobu'. it is a nice utility to securely take away Associate in Nursingd purge an recent kernel from the system and can ne'er take away the presently running kernel.
Install byobu with the apt command below.
sudo apt install byobu
Whet it's complete, check installed kernel version on the system.
dpkg -l | grep linux-image
We will get the result as below.
On the server, iI have put in 3 versions of the Ubuntu kernel: four.4.62 - 4.4.78 - 4.11.2. And for currently, the system is victimization the most recent kernel four.11.2. we are going to take away the recent kernel four.4 and leave the most recent one four.11.2.
Run the command below to remove the old kernel.
sudo purge-old-kernels
If you see the result below:
No kernels are eligible for removal
Then you simply have two kernel versions put in. By default, byobu can keep a minimum of two kernel versions on the system to make sure that you just have a disengagement kernel once the primary one fails.
If you would like to stay the sole one (the latest) kernel, then you'll use the command below to get rid of all except one Kernel.
purge-old-kernels --keep 1 -q
Now update grub and you will get the only one kernel version installed on the system.
sudo update-grub
The Ubuntu Kernel now could be upgraded to the newest version four.11.2 from the inject kernel build, the previous kernel version has been faraway from the system for liberating disc space.
- 0 Users Found This Useful