Hello everyone, today we will learn how to install the latest Linux kernel 4.0 from Elrepo or source code. The Linux kernel 4.0, codenamed ' Hurr Durr I ' A sheep ', is by far the newest backbone kernel. It is the kernel released after the stable version of 3.19.4. April 12 is the big day for all open source sports enthusiasts, and Linux Torvalds announces the release of Linux kernel 4.0, which is now available. Due to the inclusion of some great features, such as no restart patches (real-time patches), new upgrade drivers, the latest hardware support and a lot of interesting features are new versions, it was originally expected to be an important version. But actually kernel 4.0 is not considered an important version of the expectation, and Linus indicates that 4.1 is expected to be a more important version. Real-time patching has been integrated into the SUSE Enterprise Linux operating system. You can view more details about this release on the announcement.
warning : Installing a new kernel may cause your system to become unusable or unstable. If you are still using the following command to continue the installation, make sure to back up all important data to the external hard drive.
Installing the Linux kernel on Ubuntu 15.04 4.0
If you are using the Linux distribution version of Ubuntu 15.04, you can install it directly through the Ubuntu kernel website. To install the latest Linux kernel 4.0 on your Ubuntu15.04, you need to run the following command under root access in the shell or terminal.
In 64-bit Ubuntu 15.04
$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.0-vivid/linux-headers-4.0.0-040000-generic_4.0.0-040000.201504121935_amd64.deb
$ sudo dpkg -i linux-headers-4.0.0*.deb linux-image-4.0.0*.deb
In 32-bit Ubuntu 15.04
$ wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.0-vivid/linux-headers-4.0.0-040000-generic_4.0.0-040000.201504121935_i386.deb
$ sudo dpkg -i linux-headers-4.0.0*.deb linux-image-4.0.0*.deb
Installing the Linux kernel on CentOS 7 4.0
There are two easy ways to install Linux kernel 4.0 on CentOS 7.
- Installing from the Elrepo software warehouse
- Compiling the installation from source code
We first install with Elrepo, which is the simplest way:
Installing with Elrepo
1. Download and install Elrepo
We first download the Elrepo GPG key and install the Relrepo-release installation package. Since we are using CentOS 7, we use the following command to install ELREPO-RELEASE-7.0-2.EL7.ELREPO.NOARCH.RPM.
Note: If you have secure boot enabled, please check this page for more information.
# rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
# rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
2. Upgrading the Linux kernel to version 4.0
We are now ready to install the latest stable version of kernel 4.0 from the Elrepo software warehouse. Install it we need to enter the following command in the shell or terminal of CentOS 7.
# yum --enablerepo=elrepo-kernel install kernel-ml
The above command will automatically install the Linux kernel 4.0 built for CentOS 7.
Now, the following is another way to install the latest kernel 4.0 by compiling the source code.
Compiling the installation from source code
1. Installing dependent software
First we need to install the dependent software for compiling the Linux kernel. To accomplish this, we need to run the following command in a terminal or shell.
# yum groupinstall "Development Tools"
# yum install gcc ncurses ncurses-devel
Then, we will upgrade our entire system.
# yum update
2. Download the source code
We now download the latest released Linux kernel 4.0 source code from the official repository of the Linux kernel via the wget command. You can also use your browser to download the kernel directly from the kernel.org website.
# cd /tmp/
# wget https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.0.tar.xz
3. Unzip the tar compress package
After downloading the file, we'll unzip it under the/usr/src/folder using the following command.
# tar -xf linux-4.0.tar.xz -C /usr/src/
# cd /usr/src/linux-4.0/
4. Configuration
There are two options for configuring the Linux kernel. We can create a new custom profile or use an existing configuration file to build and install the Linux kernel. It all depends on your own needs.
Configuring a new kernel
Now we run the Make Menuconfig command in the shell or terminal to configure the Linux kernel. When we execute the following command, a pop-up window with all the menus is displayed. Here we can choose our new kernel configuration. If you are unfamiliar with these menus, tap the ESC key two times to exit.
# make menuconfig
Existing configurations
If you want to configure your latest kernel with an existing configuration file, enter the following command. If you have any adjustments to the configuration, you can choose Y or N, or just press ENTER to continue.
# make oldconfig
5. Compiling the Linux kernel
Next, we'll execute the make command to compile kernel 4.0. Depending on your system configuration, compiling takes at least 20-30 minutes.
Note: If an error occurs while compiling the kernel bc command not found
, you can fix this error by installing BC with the yum install BC command.
# make
6. Install the Linux kernel 4.0
After the compilation is complete, we will finally install the kernel on your Linux system. The following command creates a file in the/boot directory and a new kernel entry in the Grub menu.
# make modules_install install
7. Verify the kernel
After installing the latest kernel 4.0 we want to be able to verify it. To do this we only need to enter the following command in the terminal. If all goes well, we'll see the kernel version, such as 4.0, appearing in the output list.
# uname -r
Conclusion
Well, we managed to install the latest Linux kernel version 4.0 on our CentOS 7 operating system. It is not usually necessary to upgrade the Linux kernel, because the hardware that is running well with previous versions may not be suitable for the new version. We want to make sure that it includes features and accessories that will make your hardware work properly. But in most cases, the new stable version kernel will make your hardware more performance. So if you have any questions, comments, feedback, please note in the comment box below, let us know what issues need to be added or removed. Thanks a lot! Enjoy the latest stable Linux kernel 4.0:-)
How to install the Linux kernel on Ubuntu/centos 4.0