You are on page 1of 9

Kernel Upgrade Introduction

In this KB, we will see how to upgrade the kernel on Red Hat Linux Enterprise systems. We
will show you how to perform a automated upgrades of the kernel using the yum and rpm
package management tools.

Before continuing on, a word of caution. I recommend avoiding kernel updates unless absolutely
necessary. Generally speaking, if it's not broke, don't try and fix it. So unless there is a
vulnerability or lack of hardware/driver support in the currently installed kernel on your system,
I would recommend against the installation of a new/updated kernel. Installing a new kernel
could have wide spread and unknown consequences to your system and/or might not be
supported by your hardware/installed software. Now that I got that off my chest, I'll get off my
soapbox so we can get to work!

Kernel Upgrade/Update on Red Hat Enterprise Linux

Red Hat use a combination of tools such as yum for package retrieval and rpm for package
management. If you system is registered with the Red Hat Network (RHN), yum will
automatically download and resolve dependencies for rpm based installs. If you system is not
registered with RHN, you can still upgrade the kernel, but you will have to manually resolve any
dependencies (downloading and installing any dependent rpms.) Yum will connect to the RHN
(Red Hat Network) and scan the repository for updated packages (including your kernel.) If
there are updates available, yum will resolve their dependencies and mark the additional
packages for download/installation. Once yum has downloaded all the package(s), it will begin
installing the packages using rpm (this will configure and register the package with the OS.)

1. Before we can use yum, we must first register the server with the RHN (Red Hat
Network).

Note: If you registered your OS at the time of installation, you can skip this step

Begin the registration process


[root@RHEL01 ~]# rhn_register
2.
You'll be presented with a screen similar to the following, click Next to continue:
Enter your login information for the Red Hat Network (RHN) and click Next:

Enter a profile name for the server and click Next:


Leave the defaults selected and click Next:

Click Next on the Send Profile page:


Your system's information will be sent/registered with the Red Hat Network (RHN):

Click OK on the subscription details page:


Click Finish to complete the registration with the RHN:

3. Check to see if there are updates available for the system

Check for updates to the kernel package only:


[root@RHEL01 ~]# yum check-update kernel
Loaded plugins: rhnplugin
kernel.x86_64 2.6.18-128.1.14.el5 rhel-x86_64-server-5

root@ubuntu:~#
4. Note: If there are no updates available, no output will be produced

Or

Check for all packages (including the kernel):


[root@RHEL01 ~]# yum check-update
Loading "installonlyn" plugin
Loading "rhnplugin" plugin
Setting up repositories
rhel-x86_64-server-5 100% |=========================| 1.3 kB 00:00
Reading repository metadata in from local files
primary.xml.gz 100% |=========================| 2.3 MB 00:01
################################################## 7019/7019
Deployment_Guide-en-
5.2-11 rhel-x86_64-serv
US.noarch
NetworkManager.x86_64 1:0.7.0-4.el5_3 rhel-x86_64-serv
ORBit2.x86_64 2.14.3-5.el5 rhel-x86_64-serv
OUTPUT TRUNCATED
2.6.18-
kernel.x86_64 rhel-x86_64-serv
128.1.14.el5
2.6.18-
kernel-headers.x86_64 rhel-x86_64-serv
128.1.14.el5
OUTPUT TRUNCATED

[root@Linux01 rhn]#
5. Note: yum returns a list of all available packages

6. A quick check of the system reveals we are running on v2.6.18-8.el5 of the Linux kernel

[root@RHEL01 ~]# rpm -qi kernel


Name : Kernel Relocations : (not relocatable)
Version : 2.6.18 Vendor : Red Hat, Inc.
Fri 26 Jan 2007 02:47:08
Release : 8.el5 Build Date :
PM EST
Wed 24 Jun 2009 8:50:56 ls20-bc1-
Install Date : Build Host :
AM EDT 14.build.redhat.com
System Source kernel-2.6.18-
Group : :
Environment/Kernel RPM 8.el5.src.rpm
Size : 75875879 License : GPLv2
DSA/SHA1, Fri 26 Jan 2007 09:12:24 PM EST, Key ID
Signature :
5326810137017186
Packager : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>
Summary : The Linux kernel (the core of the Linux operating system)
Description :
The kernel package contains the Linux kernel (vmlinuz), the core of any
Linux operating system. The kernel handles the basic functions
of the operating system: memory allocation, process allocation, device
input and output, etc.
[root@RHEL01 ~
7.

[root@RHEL01 ~]# uname -a


Linux RHEL01 2.6.18-8.el5 #1 SMP Fri Jan 26 14:15:14 EST 2007 x86_64
x86_64x86_64 GNU/Linux
[root@RHEL01 ~]#
8.
9. Install the new kernel using yum

Update the kernel package only:


[root@RHEL01 ~]# yum update kernel
Loading "rhnplugin" plugin
Setting up Update Process
Resolving Dependencies
--> Running transaction check
---> Package kernel.x86_64 0:2.6.18-128.1.14.el5 set to be installed
--> Finished Dependency Resolution
.
Dependencies Resolved
==========================================================
Package Arch Version Repository Size
==========================================================
Installing: kernel x86_64 2.6.18-128.1.14.el5 rhel-x86_64-server-5 17 M
.
Transaction Summary
==========================================================
Install 1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
.
Total download size: 17 M
Is this ok [y/N]: y
10.
Or

Update all packages including the kernel:


[root@RHEL01 ~]# yum update
Loading "installonlyn" plugin
Loading "rhnplugin" plugin
Setting up Update Process
Setting up repositories
100% |=========================| 1.3
rhel-x86_64-server-5 00:00
kB
Reading repository metadata in from local files
100% |=========================| 2.3
primary.xml.gz 00:01
MB
################################################## 7019/7019
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for redhat-lsb to pack into transaction set.
redhat-lsb-3.1- 100% |=========================| 12
00:00
12.3.EL.x8 kB
---> Package redhat-lsb.x86_64 0:3.1-12.3.EL set to be updated
OUTPUT TRUNCATED
.
Transaction Summary
==========================================================
Install 33 Package(s)
Update 270 Package(s)
Remove 0 Package(s)
.
Total download size: 255 M
Is this ok [y/N]: y

11. Note: There may also be other available packages that need updating on the system (as
seen above.) Yum should take care of the kernel as well as any other packages and
associated dependencies on the system.

After answering yes to the continue question, yum will pull all the new packages and
their dependencies from the RHN repository. It will then configure them, and update
your boot loader to use the new kernel (requires a reboot).
12. The new kernel is now installed and ready for use. Reboot the system to boot into the
new kernel image

[root@RHEL01 ~]# init 6


13.
14. Once the system has come back up, login and verify your running from the new kernel
image

[root@RHEL01 ~]# uname -a


Linux REHL01 2.6.18-128.1.14.el5 #1 SMP Mon Jun 1 15:52:58 EDT 2009
x86_64 x86_64x86_64 GNU/Linux
[root@RHEL01 ~]#
15.

Good luck on the kernel upgrade!

You might also like