How to Install / Compile Linux Kernel 3.5 / 3.4.6 / 3.3 / 3.2 / 3.0 in Fedora 17 / 16 / 15 / 14

Here in this post I will explain how to compile and install Linux Kernel 3.0 and Linux Kernel 3.1 in Fedora 15. Linux Kernel 3.0.1 stable version has released yesterday and you can download it from kernel.org. If you are new to Linux then I strongly recommend you try with Linux Kernel 3.0 and not with Linux Kernel 3.0.1. You can later patch it to Linux Kernel 3.0.

Ubuntu and Debian users Click Here.

Update:

Follow the same steps to compile and install Linux Kernel 3.5 / 3.4.6 / 3.3 / 3.2 / 3.1 / 3.0.x in your system.

Dependencies

To compile Linux Kernel the following are required to be installed.

  • gcc latest version,
  • ncurses development package and
  • system packages should be up-to date

To install the dependencies run the following commands in terminal and type the password for the user, when prompted.

For gcc

sudo yum install gcc

For ncurses development package

sudo yum install ncurses-devel

After installing the above packages then update your system by running the following command

sudo yum update

Now download the Linux Kernel 3.0 from kernel.org or by using the below command.

Note:

If you are trying with Linux Kernel 3.5 / 3.4.6 / 3.3 / 3.2 / 3.1 / 3.0.x then just replace the name linux-3.0 with linux-3.5 / linux-3.4.6 / linux-3.3 / linux-3.2 / linux-3.1 / linux-3.0.x in all commands below.

wget http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.0.tar.bz2

Once the download complete move to the directory where you have downloaded the kernel package “linux-3.0.tar.bz2“. Now extract the tar file to the location “/usr/src/“.

To move to the directory, for example if the downloaded package is in your Downloads directory. Use the below command.

cd Downloads/

To extract the tar file run the following command. Type the password for the user when prompted.

sudo tar -xvf linux-3.0.tar.bz2 -C /usr/src/

Now move to the directory where the extracted file is, or copy and paste the below command in terminal.

cd /usr/src/linux-3.0/

Now you can configure, compile and install Linux Kernel 3.0 in your system. Run the commands one by one and type the password for the user, when prompted.

To Configure

sudo make menuconfig

The above command is used to configure the Linux kernel. Once you execute the command, you will get a pop up window with the list of menus and you can select the items for the new configuration. If your unfamiliar with the configuration just check for the file systems menu and check whether ext4 is chosen or not, if not select it and save the configuration. Check the screen shot below for menuconfig.

If you like to have your existing configuration then run the below command.

sudo make oldconfig

There are other alternate configuration commands are available and you can find them in README file under linux-3.0 directory.

To Compile

sudo make

The above command is used to compile the Linux Kernel. It will take some time to complete it, approximately 40 min to 50 min it depends on your system configuration.

To Install

sudo make modules_install install

The above command will install the Linux Kernel 3.0 into your system. It will create some files under /boot/ directory and it will automatically make a entry in your grub.conf.

The files are,

  • System.map-3.0.0
  • vmlinuz-3.0.0
  • initramfs-3.0.0.img

To make it default just modify the grub.conf or menu.lst under “/boot/grub/” directory. Open the file using below command.

sudo gedit /boot/grub/menu.lst

Just check the entry for fedora 3.0.0, if it is in first place then change default=0, if not check for the exact position and give the corresponding value in default. Restart your system by default it will boot in fedora 3.0.0, you can able to see while booting if not press any key to change it. To check after booting open a terminal and type

Related Posts Plugin for WordPress, Blogger...

  • http://www.lquery.com sathia

    Great tutorial

    • http://www.howopensource.com Manivannan

      Thanks Sathia :)

      • Siddharth

        I am trying to carryout the procedure provided by you for Kernel installation on CentOS 5.5

        Compilation was done without any issue

        But during installation follwing error is not allowing me to go further

        sudo make modules_install install
        cp: cannot stat `/usr/src/linux-3.0.8/modules.builtin': No such file or directory
        make: *** [_modinst_] Error 1

        Please help

  • Pingback: How to Compile and Install Linux Kernel 3.0 in Ubuntu 11.04, 10.10 and 10.04 | How Opensource()

  • Pingback: How to install kernel 3.1-rc1 in Ubuntu 11.04 and Fedora 15 | How Opensource()

  • sekar

    very useful thanks

    • http://www.howopensource.com Manivannan

      Thanks and Welcome :) Sekar.

  • Vadivu

    Excellent site for Linux & co., community…

    • http://www.howopensource.com Manivannan

      Thanks Sister :)

  • mathu suresh

    wonderful tutorial …

    • http://www.howopensource.com Manivannan

      Thanks Mathu Suresh:)

  • Pingback: [HowTo] Update / Patch latest kernel in ubuntu and fedora | How Opensource()

  • Hamed

    very useful tutorial.

    • http://www.howopensource.com Manivannan

      Thanks Hamed :) and Welcome to HowOpensource :)

  • Nick

    Thanks! i upgraded to 3.0.3 with no problems thanks to your guide!

    • http://www.howopensource.com Manivannan

      Welcome Nick :)

      • Nagesh

        hi..

        currently using linux 2.6.40.4-5.fc15.i686.PAE… but i want to compile and install old version i.e linux-2.6.32.46

        i hav followed everything what u said…. i hav installed GCC,ncuress-devel
        and yum install update too…

        but im getting following error can someone help me out plzz..

        [nagesh@localhost linux-2.6.32.46]$ sudo make
        scripts/kconfig/conf -s arch/x86/Kconfig
        CHK include/linux/version.h
        CHK include/linux/utsrelease.h
        SYMLINK include/asm -> include/asm-x86
        CALL scripts/checksyscalls.sh
        CHK include/linux/compile.h

        CHK include/linux/version.h
        make[2]: `scripts/unifdef’ is up to date.
        HOSTCC Documentation/video4linux/v4lgrab
        Documentation/video4linux/v4lgrab.c:34:28: fatal error: linux/videodev.h: No such file or directory
        compilation terminated.
        make[2]: *** [Documentation/video4linux/v4lgrab] Error 1
        make[1]: *** [Documentation/video4linux] Error 2
        make: *** [vmlinux] Error 2
        [nagesh@localhost linux-2.6.32.46]$
        [nagesh@localhost linux-2.6.32.46]$
        [nagesh@localhost linux-2.6.32.46]$ uname -r
        2.6.40.4-5.fc15.i686.PAE
        [nagesh@localhost linux-2.6.32.46]$

        Thank u

        • http://www.howopensource.com Manivannan

          Hi Nagesh,

          You are trying to compile the older version Kernel 2.6.x and following the procedure for 3.x.

          Your System running on Fedora 15 and why you are trying with older version?

          In Fedora 15, I din’t try compiling the older version. If you really needed I will give you the procedure soon.

        • ductien88

          hi. I fixed error linux/videodev.h. I think you pratice project add system call ( so I too, lol ). You can coppy videodev.h in linux-2.6.32.46 to /usr/src/include/linux . Then remake file .

          • http://www.howopensource.com Manivannan

            Hi ductien88,

            Thanks for the info, It may help someone. Great work dude.

  • Anonymous

    just a note, use make rpm ( helps in adding/removing different kernel images), Also, by default you are not exploiting your multicore cpu’s so use make -j(n) where n is the number of jobs you want to run concurrently.

  • Oliv

    Hi, thanks, clear and easy !

    I have a question… I use Fedora 15 . With your help I could install successfully 3.1.0-rc7.

    But looking at my directories I noticed in /lib/modules/ the following directories :
    [Oliv@qwerty modules]$ ls
    2.6.38.6-26.rc1.fc15.i686 2.6.40.4-5.fc15.i686
    2.6.40.3-0.fc15.i686 3.1.0-rc7

    And if I look at their size :

    2.6.38.6-26.rc1.fc15.i686 : 65M .
    2.6.40.3-0.fc15.i686 : 68M .
    2.6.40.4-5.fc15.i686 : 68M .
    and surprise :
    3.1.0-rc7 : 910 M !!!

    It seems my kernel is oversized… is it normal ? is it coming from my kernel configuration ??

    Thanks !

    Olivier

    • http://mjanja.co.ke Alan

      Your kernel was compiled with debugging enabled. Check one of the .ko files in /lib/modules/3.1.0-rc7/ against one of the Fedora ones… example:

      ls -lh /lib/modules/3.1.0-rc7/kernel/drivers/video/intelfb/intelfb.ko

      You need to remove the debugging symbols from the modules:

      sudo find /lib/modules/3.1.0-rc7 -iname “*.ko” -exec strip –strip-debug {} \;

      :)

  • bob

    Hi, I’m looking for steps to compile 2.6.x kernel in fedora 15, can you make tutorial for it?

    • http://www.howopensource.com Manivannan

      Hi Bob,

      Follow the same steps to compile kernel 2.6.x in Fedora 15. Its working I have tested.

      • bob

        Thank you for the tutorial. I finally compiled the kernel. However Im still very new to this linux thing, so I have few questions, hope you can help me.

        1. How can I delete the compilation + installation result, since I compiled some versions of kernel, I want to delete some of them.
        2. How much space does this compiled kernel take? Is it as much as the original fedora 15 installation?
        3. Is it okay to delete the original fedora 15 (the one with 2.6.38 kernel) and just use the newest kernel we compiled? (i.e, kernel 3.0)

        • http://www.howopensource.com Manivannan

          Hi Bob,

          1. You can delete it directly. If permission denied use command line as root user.

          2. More than a gb

          3. Yes, you can but Why you want to delete the default version?

  • Georges Le Duc

    Fantastic! Worked on first try. Very useful tutorial, great work.

    Many thanks.

    • http://www.howopensource.com Manivannan

      Hi Georges,

      Thanks and Welcome to HowOpenSource!! :)

  • Murali

    Excellent tutorial, worked without any glitch. Upgraded to 3.1 from Fedora 15.

    Thanks

    • http://www.howopensource.com Manivannan

      Hi Murali,

      Thanks and Welcome to HowOpenSource :)

  • Elliot

    Great tutorial! Thank you very much for sharing.
    Regards

  • Elliot

    I was able to upgrade Fedora 14 to 3.1.1!

  • http://linuxspy.info Rajbir

    It works fine for me as well.

  • habernir

    thanks alot. work perfect!!!

  • john

    Thanks so much – so clearly explained.
    Recompiled 3.00 on Fedora 14

  • habernir

    tell me its the same in kernel 3.3 rc2 ??

    • http://www.howopensource.com Manivannan

      Hi Habernir,

      Yes, Same Procedure in Kernel 3.3 rc2

      • habernir

        thanks

  • Andrey

    Hi
    Fedora 14 + kernel 3.0 —- rules !!!!!

  • habernir

    how do icompile it with ntfs support?? (becuase when i try to mount ntfs drive it write me:
    “ntfs-3g-mount fuse device is missing”)

  • habernir

    How do i remove kernel that i compile and install ?

    • http://www.howopensource.com Manivannan

      Hi Habernir,

      Log in using the previous Kernel and Delete the directory of compiled kernel then update your grub.

      • Nir

        do you mean to delete /usr/src/linux-3.X??

        and after that

        preform this command:

        “grub2-mkconfig -o /boot/grub2/grub.cfg”

        (i use fedora 17 beta with kernel 3.4 :) )

  • sash

    What is the advantage of doing that in comparison to the usage of the F17-rawhide kernel version? I do it that way in F16.
    system-update: yum –exclude=kernel\* –exclude=kmod-staging\* update
    kernel-update: yum update kernel kernel-headers kernel-devel –enablerepo=rawhide –nogpgcheck
    Works.

  • quophyie

    Very Very good!! I tried a number of tutorials but non of them worked! THIS IS THE ONLY TUTORIAL THAT worked. Very much appreciated. Keep up the good work!!

  • Pingback: how to identify the kernel I built after install()

  • Nir

    Anyone try that tutorial in fedora 17 beta and kernel 3.4 rc ?

  • Arun

    Very useful.. but i have one query,bzImage in x86/boot was missing how to get it back?

  • Pingback: Linux Kernel 3.5 Quantal Released | HowOpenSource()

  • Luca

    Hi Manivannan,

    I have to install the latest kernel (3.5.x) on Fedora 14 as the 3D softwares I’m currently use are certified&tested on this version ,but I want to take full advantage of my new Intel I7 2600k CPU,so my questions are:

    1. how can I get/install also the kernel devel & header?
    I need them to install the Nvidia proprietary driver for my Quadro card

    2. Do I need any special parameters to specify to take full advantage of a modern multicore cpu such
    as intel core i7 sandy bridge and ivy bridge?

    thanks in advance if you (or anybody) can help me out

    cheers,
    Luca

  • Srini

    Hi Mani,

    Why you are not used the make bzImage command?

    Thanks,
    Srini

    • hashhash

      because it was not necessary

  • Peter

    I followed your instruction and compile kernel modules Fedora 3.6.11 on Fedora 17, which uses this version of the kernel. When I tried to install a module, insmod openvswitch, I got an error … “Could not insert module. Invalid format error.”.

    Any one has any hints of what happens?

    Thanks

  • Wilson

    Excellent site for Linux people…

  • Guest34

    how do I do this to fedora 20 and also when the stable kernel right now is 3.12.6.ta.xz

    • Guest34

      3.12.6.tar.xz

  • fedora online

    just smoke pot