How to install Linux kernel 4.0 on Ubuntu/CentOS?

Source: Internet
Author: User
Tags root access

How to install Linux kernel 4.0 on Ubuntu/CentOS?

Hello everyone, today we will learn how to install the latest Linux kernel 4.0 from Elrepo or source code. Linux Kernel 4.0, codenamed 'hurr durr I'm a sheep ', is the latest main kernel. It is the kernel released after stable version 3.19.4. April 12 was a big day for all open-source sports enthusiasts. Linux Torvalds announced the release of Linux kernel 4.0, which is now available. Because it includes some great features, such as no restart patch (Real-time patch), new upgrade drivers, the latest hardware support, and many interesting features, there are new versions, it was originally expected to be an important version. But in fact, kernel 4.0 is not considered to be an important version in expectation. Linus says it is expected that kernel 4.1 will be a more important version. The real-time patch feature has been integrated into the SUSE Enterprise Edition Linux operating system. You can view more details about this release on the release announcement.

Warning installing a new kernel may make your system unavailable or unstable. If you still use the following command to continue the installation, make sure to back up all important data to the external hard disk.

 

Install Linux kernel 15.04 on Ubuntu 4.0

If you are using Ubuntu 15.04, you can directly install it through the Ubuntu kernel website. Install the latest Linux kernel 4.0 on Ubuntu15.04. You need to run the following command under the root access permission in the shell or terminal.

 

In 64-bit Ubuntu 15.04
  1. $ 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
  2. $ sudo dpkg -i linux-headers-4.0.0*.deb linux-image-4.0.0*.deb

 

In 32-bit Ubuntu 15.04
  1. $ 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
  2. $ sudo dpkg -i linux-headers-4.0.0*.deb linux-image-4.0.0*.deb

 

Install Linux kernel 4.0 on CentOS 7.

We can use two simple methods to install Linux kernel 4.0 on CentOS 7.

  1. Install from Elrepo software Repository
  2. Compile and install from source code

We first use ElRepo for installation, which is the simplest method:

 

Use Elrepo for Installation

 

1. Download and install ELRepo

Download the GPG key of ELRepo and install the installation package of relrepo-release. Because we are using CentOS 7, we use the following command to install the elrepo-release-7.0-2.el7.elrepo.noarch.rpm.

NOTE: If secure boot is enabled, view this webpage for more information.

  1. # rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
  2. # rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm

 

2. Upgrade the Linux kernel to version 4.0.

Now we are going to install the latest stable version kernel 4.0 from the ELRepo software repository. To install CentOS 7, run the following command in the shell or terminal of CentOS 7.

  1. # yum --enablerepo=elrepo-kernel install kernel-ml

The preceding command automatically installs 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.

 

Compile and install from source code

 

1. Install dependent Software

First, we need to install the dependent software for compiling the Linux kernel. To do this, we need to run the following command in a terminal or shell.

  1. # yum groupinstall "Development Tools"
  2. # yum install gcc ncurses ncurses-devel

Then, we will upgrade our entire system.

  1. # yum update

 

2. Download the source code

Now we use the wget command to download the latest source code of Linux kernel 4.0 from the official Linux kernel repository. You can also use your browser to download the kernel directly from the kernel.org website.

  1. # cd /tmp/
  2. # wget https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.0.tar.xz

 

3. decompress the tar package

After the file is downloaded, run the following command in the/usr/src/folder to decompress it.

  1. # tar -xf linux-4.0.tar.xz -C /usr/src/
  2. # cd /usr/src/linux-4.0/

 

4. Configuration

There are two options for configuring the Linux kernel. You can create a new custom configuration file or use an existing configuration file to build and install the Linux kernel. It depends on your own needs.

 

Configure a new kernel

Now we can run the make menuconfig command in shell or terminal to configure the Linux kernel. After executing the following command, a pop-up window containing all menus is displayed. Here we can choose our new Kernel configuration. If you are not familiar with these menus, press ESC twice to exit.

  1. # make menuconfig

 

Existing Configuration

If you want to use an existing configuration file to configure your latest kernel, enter the following command. If you have any adjustments to the configuration, you can select Y or N, or simply press Enter to continue.

  1. # make oldconfig

 

5. Compile the Linux Kernel

Next, we will execute the make command to compile the kernel 4.0. Depending on your system configuration, it takes at least 20-30 minutes to compile.

Note: if this occurs during kernel compilationbc command not foundYou can use the yum install bc command to install bc to fix this error.

  1. # make

 

6. install 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 creates a new kernel entry in the Grub menu.

  1. # make modules_install install

 

7. Verify the kernel

After installing the latest kernel 4.0, we hope to verify it. To do this, you only need to enter the following command in the terminal. If everything goes smoothly, we will see the kernel version, such as 4.0 in the output list.

  1. # uname -r

 

Conclusion

Now, we have successfully installed the latest Linux kernel version 4.0 on our CentOS 7 operating system. Generally, you do not need to upgrade the Linux kernel, because the hardware that runs well with the previous version may not be suitable for the new version. Make sure that it includes functions and accessories that make your hardware work normally. But in most cases, the new stable version of the kernel can make your hardware performance better. Therefore, if you have any questions, comments, or feedbacks, please note them in the comment box below to let us know what issues need to be added or deleted. Thank you! Enjoy the latest stable version of Linux kernel 4.0 :-)

How to install Linux Kernel 4.0 on CentOS 7

Linux Kernel 4.0 is approaching

The Ubuntu 13.10 (Saucy Salamander) Kernel has been upgraded to Linux Kernel 3.10 RC5

Linux Kernel 3.4.62 LTS is now available for download

How to install Linux kernel 13.10 On Ubuntu 3.12

How to install the 3.16.7 CKT2 kernel in Ubuntu 14.10, Ubuntu 14.04, and its derivative versions

Linux Kernel: click here
Linux Kernel: click here

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.