How to install kernel on debian !

Debian wheezy using 3.2.0-4-amd64 as default kernel which is old. For that reason today i installed the latest  kernel downloaded from kernel.org. If you are Curious that how you can install the new kernel easily then follow  instructions:

Note: Make sure you have enough space before keep going(More than 8gb)



First we download the kernel:

wget -c http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.7.8.tar.xz


Then download the sign file:

wget -c http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.7.8.tar.sign

Note: i used -c with for wget since i was resumed the download.


Now time of unxz tool:

unxz linux-3.7.8.tar.xz


To be safe i verified the signature by issuing following command:

gpg --verify linux-3.7.8.tar.sign linux-3.7.8.tar






So everything OK.


This time we need to extract the the tar file:

tar xvf  linux-3.7.8.tar ; cd linux-3.7.8


I want fresh installation , So i ran :

make menuconfig

And got error :



So i had to install libncurses5-dev: apt-get install libncurses5-dev Or install all required tools:

sudo apt-get install fakeroot build-essential kernel-package ncurses-bin ncurses-dev


 again run :

make menuconfig

And see if you need anything to change , When finished just use tab to select "Exit" or "Cancel"

At last :





When it will exit the windows , you will see output in your terminal :

root@scientific:/home/scientist/kernel/linux-3.7.8# make menuconfig
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/lxdialog/checklist.o
  HOSTCC  scripts/kconfig/lxdialog/inputbox.o
  HOSTCC  scripts/kconfig/lxdialog/menubox.o
  HOSTCC  scripts/kconfig/lxdialog/textbox.o
  HOSTCC  scripts/kconfig/lxdialog/util.o
  HOSTCC  scripts/kconfig/lxdialog/yesno.o
  HOSTCC  scripts/kconfig/mconf.o
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/mconf
scripts/kconfig/mconf Kconfig
#
# using defaults found in /boot/config-3.2.0-4-amd64
#
/boot/config-3.2.0-4-amd64:1564:warning: symbol value 'm' invalid for BMP085
/boot/config-3.2.0-4-amd64:2974:warning: symbol value 'm' invalid for POWER_SUPPLY
/boot/config-3.2.0-4-amd64:3209:warning: symbol value 'm' invalid for MFD_WM8400
/boot/config-3.2.0-4-amd64:4684:warning: symbol value 'm' invalid for COMEDI_MISC_DRIVERS
/boot/config-3.2.0-4-amd64:4691:warning: symbol value 'm' invalid for COMEDI_PCI_DRIVERS
/boot/config-3.2.0-4-amd64:4748:warning: symbol value 'm' invalid for COMEDI_PCMCIA_DRIVERS
/boot/config-3.2.0-4-amd64:4756:warning: symbol value 'm' invalid for COMEDI_USB_DRIVERS
#
# configuration written to .config
#


*** End of the configuration.
*** Execute 'make' to start the build or try 'make help'.



Avoid everything , Just important indication is "configuration written to .config" 


  clean all unusual files(Generated automatically) following command:

make-kpkg clean
 
 
 
I simply want to build a Debian package(.deb extension) so that i can use default tool dpkg to install the new kernel:
 
 fakeroot make-kpkg -j6 --initrd --revision=3.7.8 --append-to-version=-amd64 kernel_image kernel_headers
 
 
Also calculating the compile time you can run:
 
 time fakeroot make-kpkg -j6 --initrd --revision=3.7.8 --append-to-version=-amd64 kernel_image kernel_headers
 
Note: j5 for parallel if we have multi processor  
When you ran this command, you will see in your terminal lots of output such as :
 [M]  fs/ext2/file.o
CC [M] fs/ext2/ialloc.o
CC [M] fs/ext2/inode.o
CC [M] fs/ext2/ioctl.o
CC [M] fs/ext2/namei.o
CC [M] fs/ext2/super.o
CC [M] fs/ext2/symlink.o
CC [M] fs/ext2/xattr.o
CC [M] fs/ext2/xattr_user.o
CC [M] fs/ext2/xattr_trusted.o
CC [M] fs/ext2/acl.o
CC [M] fs/ext2/xattr_security.o
LD [M] fs/ext2/ext2.o
LD fs/ext3/built-in.o
CC [M] fs/ext3/balloc.o
CC [M] fs/ext3/bitmap.o
CC [M] fs/ext3/dir.o
CC [M] fs/ext3/file.o
CC [M] fs/ext3/fsync.o




Simply it is compiling all the sources, programming functions, system call , devices driver etc.


Install the .deb package and reboot the system and select the new kernel to boot.

entific:/home/scientist# uname -r ; arch
3.7.8-amd64
x86_64


Caution: Be careful When compiling kernel . The system may not even boot. So First try it on your vm . I have no responsible if it damages anything .


There is more easy way to install kernel from debian backport. But installing this kernel perfectly worked for me!




****If you have any questions, feedback then please comment here!