Howto compile and install Linux kernel 3.3rc/3.2/3.1/3.0/11.10 In ubuntu 11.04, 10.10, and 10.

Source: Internet
Author: User

Here in this post I will explain how to compile and install Linux kernel 3.0 and Linux kernel 3.1 In ubuntu. linux Kernel 3.0.1 is the latest stable release 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 you can later
PatchIt with Linux kernel 3.0.1. If you don't like to compile the kernel, then you can directly
InstallTheDebianPackages
Click here.

Fedora users
Click here.

Update: follow the same steps to compile and install the Linux kernel 3.1 in your system.

Dependencies

To compile Linux kernel The following are required to be installed.

  • GCC latest version,
  • Ncurses development package and
  • System packages shocould 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 apt-get install gcc

For ncurses development package

$ sudo apt-get install libncurses5-dev

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

$ sudo apt-get update && sudo apt-get upgrade

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.2/3.1/3.0.x then just replace the nameLinux-3.0WithLinux-3.2/linux-3.1/linux-3.0.xIn 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 forFile
Systems
Menu and check whetherExt4Is 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. cfg. Check whether it made correct entry and check for the files it
Created.

The files under/boot/directory are,

  • System. Map-3.0.0
  • Vmlinuz-3.0.0
  • Initrd. img-3.0.0
  • Config-3.0.0

If you unable to findInitrd. img-3.0.0File then create it. Run the below command to create it.

$ sudo update-initramfs -u -k 3.0.0
Update

If the above command unable to update/generate the initramfs then run the following command to create new initramfs.

$ sudo update-initramfs -c -k 3.0.0

YourGrub. cfgFile shoshould be like the screen shots (example) below if not edit it.

For Linux kernel 3.0

For Linux kernel 3.0.1

To modify the grub. cfg under"/Boot/GRUB/"Directory. open the file using below command.

$ sudo gedit /boot/grub/grub.cfg

After modifying yourGrub. cfg, Update your grub by running the following command.

$ sudo update-grub

Restart your system by default it will boot in Ubuntu 3.0.0, you can able to see while booting. To check after booting open a terminal and type"Uname-R". Check the screen shot below.

Hope this will be helpful for you !!!

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.