Install latest Kernel from source in Fedora/RHEL/Centos

This will show you how to install latest kernel from source in fedora/RHEL/CentOS

This was tested and is workintg fine in Fedora 11 .

The release of my Fedora system was I checked it through the following command.

 [root@localhost src]# uname -a.

1.Download source from
# cd /usr/src
# wget

2.Unpack the source file

#tar xvjf linux-

3.Create configuration file
First be sure that packages like kernel-headers kernel-devel and gcc are installed, if not :

 # yum install kernel-devel kernel-headers gcc -y
# cd linux-
 # cp /usr/src/kernels/ . (dont forget dot   in the  eind of the line)
 [root@test1 linux-]# make oldconfig

HOSTCC scripts/basic/fixdep

scripts/basic/fixdep.c: In function âtrapsâ:

scripts/basic/fixdep.c:377: warning: dereferencing type-punned pointer will break strict-aliasing rules

scripts/basic/fixdep.c:379: warning: dereferencing type-punned pointer will break strict-aliasing rules

HOSTCC scripts/basic/docproc

HOSTCC scripts/basic/hash

HOSTCC scripts/kconfig/conf.o

HOSTCC scripts/kconfig/kxgettext.o

SHIPPED scripts/kconfig/

SHIPPED scripts/kconfig/lex.zconf.c

SHIPPED scripts/kconfig/zconf.hash.c

HOSTCC scripts/kconfig/

HOSTLD scripts/kconfig/conf

scripts/kconfig/conf -o arch/x86/Kconfig

.config:3811:warning: symbol value ‘m’ invalid for GFS2_FS_LOCKING_DLM


* Restart config…



* General setup

4.Compile kernel and copy the new kernel to the /boot directory

# make dep
 # make clean
 # make bzImage
 # cp arch/x86/boot/bzImage /boot/vmlinuz-
 # chmod a+x /boot/vmlinuz-
 # cp /boot/

5.Compile and install kernel modules

# make modules (take  a long time;  be  patient)
 # make modules_install

6.Create a new initial ramdisk

# mkinitrd /boot/initrd-

7.Update GRUB
Edit the /boot/grub/menu.lit file, add the following lines into it.

 # vi /boot/grub/menu.lst

title Fedora (
root (hd0,0)
kernel /vmlinuz- ro root=/dev/mapper/VolGroup-lv_root rhgb quiet
initrd /initrd-

8.Reboot and verify

[root@test1 ~]# uname -a

Linux #1 SMP Tue Aug 18 10:38:23 EDT 2009 i686 i686 i386 GNU/Linux

  • Ris

    Very interesting and helpful article, thanks.

  • Charles

    Hello the line
    cp /usr/src/kernels/ .

    Can you please advise me?



    [color=red][root@test2 linux-]$ cp /usr/src/kernels/ .
    cp: cannot stat `/usr/src/kernels/’: No such file or directory

    [root@test2 linux-]$ cp /usr/src/kernels/ .
    cp: omitting directory `/usr/src/kernels/’
    cp: cannot stat `’: No such file or directory
    [leaf@grapes linux-][/code]$

  • Pirat9

    Copy the laste kernel that u have in :
    this example was for my installed kernel . Maybe you have other kernel version!!
    Please try again and let us know .