ExplodingPenguin.TV Linux Love, Microsoft Frustrations, and Other Geekery

7Jun/11Off

Install/Compile Linux Kernel 3.0 In Ubuntu

An RC for the Linux Kernel 3.0 was recently released. The change in the version number is mostly to mark the 3rd decade of the Linux Kernel, it doesn't bring any major changes. Still, why not try to setup the new version on your system?

There are two ways of going about this.

First Method - Download From PPA

You can download the .debs from the Ubuntu Kernel PPA. [Updated] For 3.0 Final

Install the three packages in this order:

linux-headers-...all.deb

linux-headers-3.0.0-0300-generic...deb

linux-image-...deb

Then reboot

There is a good chance you'll have to reinstall your video driver, that's what I had to do on the two systems I tested.

If you have issues and want to uninstall the new kernel, just reboot and select the old kernel at bootup. Then search the Synaptic Package manger for linux-image-3 and linux headers-3, and uninstall the packages.

Second Method - Compile It Yourself

[Updated] for 3.0 Final

I did this in Ubuntu 11.04 Natty Narwhal, but it will probably work on 10.10 and 10.04.

If you're just looking for the terminal commands to copy and paste:

sudo adduser your_username src

Logout and back in.

sudo apt-get install kernel-package build-essential libncurses5 libncurses5-dev
cd /usr/src
wget http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.0.tar.bz2
tar jxvf linux-3.0.tar.bz2
cd linux-3.0/
cp -vi /boot/config-`uname -r` .config
make menuconfig
make localmodconfig
make-kpkg clean
fakeroot make-kpkg --initrd --append-to-version=-put-your-custom-label-here kernel-image kernel-headers
cd ..
sudo dpkg -i *.deb

 

Here's what's happening.

sudo adduser your_username src

The kernel is compiled in the /usr/src directory. This command lets your user work in this directory.

sudo apt-get install kernel-package build-essential linux-source libncurses5 libncurses5-dev

This installs the software needed to customize and compile the kernel.

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

Takes you to the /usr/src directory, and downloads the kernel source.

tar jxvf linux-3.0.tar.bz2
cd linux-3.0/

Extracts the kernel files, and changes you to the source directory.

cp -vi /boot/config-`uname -r` .config

Copies your currently working configuration into the new kernel's configuration.

make menuconfig

Select "Load an Alternate Configuration File" and select .config then exit and select yes to save when prompted.

make localmodconfig

This loads the modules currently used on your system into the new kernel.

make-kpkg clean

Let's you do a "clean" build.

fakeroot make-kpkg --initrd --append-to-version=-put-your-custom-label-here kernel-image kernel-headers

Makes the magic happen Starts compiling the kernel and creates the two .deb files for install. This will take a long time. Depending on your setup this could take several minutes to a couple of hours.

cd ..
sudo dpkg -i *.deb

Takes you to the parent directory (/usr) and installs the two deb packages.

 

Create the initramfs image

cd /usr/src/linux-3.0
mkinitramfs -o /boot/initrd.img-3.0

 

Update grub.

sudo update-grub

 

If you have issues and want to uninstall the new kernel, just reboot and select the old kernel at bootup. Then search the Synaptic Package manger for linux-image-3 and linux headers-3, and uninstall the packages.

 

For more info on compiling a kernel in Ubuntu go to Ubuntu Kernel/Compile

 

 

 

Share

Posted by John

Comments (5) Trackbacks (0)
  1. Easy steps to get kernel working .debs. Thank you!
    No more cp/mv kernel images/modules 😀

  2. Thank you!!, you helped me a lot, now i have the new kernel in full capacity on my ubuntu 10.04 LTS, sorry for my poor english, I am from Brazil, and here we speak portuguese, ah, its soo hard living in a communist country…, R$ 700 in a fu*** Netbook, (URV((R$)) 700 = 451,61USS (($$)) )
    José Carlos

    • I still have issues when i try to boot using grub, it says that some files are missing in lib/modules.

  3. I compiled linux kernel 3.0 on ubuntu 10.04 dell inspiron laptop.while booting i get following message

    error:Driver ‘mdio gpio is already registered aborting … then kernel panics

    “kernel panic – not syncing:VFS : unable to mount root fs on unknown block(0,0)”

    • hi sudhi,actually i too got that problem. the real fact is you forget to type a command after the installation of the deb files sister.

      Create the initramfs image
      #sudo update-initramfs -c -k 2.6.3

      Update your grub.cfg
      #sudo update-grub


Trackbacks are disabled.