How to delete a Custom made Linux Kernel From Linux [Ubuntu] a tutorial

lionaneesh's Avatar author of How to delete a Custom made Linux Kernel From Linux [Ubuntu] a tutorial
This is an article on How to delete a Custom made Linux Kernel From Linux [Ubuntu] a tutorial in Linux.
Rated 5.00 By 1 users
While starting kernel programming.... The first thing that happens to a user is:-

He compiled a custom kernel now it doesn't works It have a tons of reasons , like because of init.d image , because of vmlinux image etc..etc...

Now some how you figured the problem and now you want to compile a new kernel "But you don't have enogh space on your hard drive....WoW!! What to do now??"

The answer is You'll have to delete your previous recompiled kernel...

How to do it :-



It is obvious that the files related to the kernel is in the /boot directory ….
Here you will find quite a bit files in my case :-
Code:
aneesh@aneesh-laptop:/boot$ ls -al -h

total 48M

drwxr-xr-x  3 root root 4.0K 2011-01-07 16:03 .

drwxr-xr-x 22 root root 4.0K 2011-01-08 09:23 ..

-rw-r--r--  1 root root 637K 2010-09-16 23:44 abi-2.6.32-24-generic

-rw-r--r--  1 root root 637K 2010-10-17 05:16 abi-2.6.32-25-generic

-rw-r--r--  1 root root 637K 2010-12-02 06:18 abi-2.6.32-27-generic

-rw-r--r--  1 root root 114K 2010-10-31 11:05 .config

-rw-r--r--  1 root root 114K 2010-09-16 23:44 config-2.6.32-24-generic

-rw-r--r--  1 root root 114K 2010-10-17 05:16 config-2.6.32-25-generic

-rw-r--r--  1 root root 114K 2011-01-07 15:29 config-2.6.32.26+drm33.12-explict-hax0r

-rw-r--r--  1 root root 114K 2010-12-02 06:18 config-2.6.32-27-generic

drwxr-xr-x  3 root root 4.0K 2011-01-07 16:06 grub

-rw-r--r--  1 root root 7.6M 2010-09-28 00:52 initrd.img-2.6.32-24-generic

-rw-r--r--  1 root root 7.6M 2010-10-25 16:52 initrd.img-2.6.32-25-generic

-rw-r--r--  1 root root 8.0M 2011-01-07 15:12 initrd.img-2.6.32-27-generic

-rw-r--r--  1 root root 157K 2010-03-23 15:07 memtest86+.bin

-rw-r--r--  1 root root 1.7M 2010-09-16 23:44 System.map-2.6.32-24-generic

-rw-r--r--  1 root root 1.7M 2010-10-17 05:16 System.map-2.6.32-25-generic

-rw-r--r--  1 root root 1.6M 2011-01-07 15:57 System.map-2.6.32.26+drm33.12-explict-hax0r

-rw-r--r--  1 root root 1.7M 2010-12-02 06:18 System.map-2.6.32-27-generic

-rw-r--r--  1 root root 1.2K 2010-09-16 23:46 vmcoreinfo-2.6.32-24-generic

-rw-r--r--  1 root root 1.2K 2010-10-17 05:17 vmcoreinfo-2.6.32-25-generic

-rw-r--r--  1 root root 1.2K 2010-12-02 06:20 vmcoreinfo-2.6.32-27-generic

-rw-r--r--  1 root root 3.9M 2010-09-16 23:44 vmlinuz-2.6.32-24-generic

-rw-r--r--  1 root root 3.9M 2010-10-17 05:16 vmlinuz-2.6.32-25-generic

-rw-r--r--  1 root root 3.9M 2011-01-07 15:57 vmlinuz-2.6.32.26+drm33.12-explict-hax0r

-rw-r--r--  1 root root 3.9M 2010-12-02 06:18 vmlinuz-2.6.32-27-generic
Warning Before deleting :-

I'd like you to warn before deleting your kernel modules...

Do this very carefully because if you delete your current generic version of the kernel modules you could mess up your system which could lead to a non-booting Linux system!!!

Deleting :-



As I had a version append to my own Linux kernel so I appended the kernel name with “explict-hax0r”

So I could grep the name and get the job done …

Code:
-rw-r--r--  1 root root 114K 2011-01-07 15:29 config-2.6.32.26+drm33.12-explict-hax0r

-rw-r--r--  1 root root 1.6M 2011-01-07 15:57 System.map-2.6.32.26+drm33.12-explict-hax0r

-rw-r--r--  1 root root 3.9M 2011-01-07 15:57 vmlinuz-2.6.32.26+drm33.12-explict-hax0r
Note :- Above in my case I dint got the initrd-2.6.32.26+drm33.12-explict-hax0r file most probably because I am working in my own kernel...

But in your case you could manually rm files by :-

deleting the following files :-
Code:
/boot/vmlinuz -*kernel version*
/boot/ initrd-*kernel version*
/boot/config-*kernel version*
/boot/system.map-*kernel version*
And one more file to be deleted is the /lib/modules file

Code:
aneesh@aneesh-laptop:/$ cd /lib/modules/

aneesh@aneesh-laptop:/lib/modules$
now simple rm -rf[because rm would not delete dirs] the :-

Code:
/lib/modules/*kernel version*
0
lionaneesh's Avatar, Join Date: Mar 2010
Invasive contributor
If the viewers could comment on this article...
It would be like a billion dolors to me ...
0
sfhdweb's Avatar, Join Date: Jan 2011
Newbie Member
thanks for sharing this great info
0
lionaneesh's Avatar, Join Date: Mar 2010
Invasive contributor
Quote:
Originally Posted by sfhdweb View Post
thanks for sharing this great info
Thanks The pleasure is all mine....
The best you could do is work with us....
Check the link below
0
sneha123's Avatar
Go4Expert Member
Hey ,,,,,its very informative site,,,,thanks for sharing that,,,its great post ! thanks a lot for these guides..they're really helpful for us........
with regards,,,
sneha,
0
lionaneesh's Avatar, Join Date: Mar 2010
Invasive contributor
Thanks But ...
If you wanna really appreciate My work...
There is a 'THANKS' button just at the ending of the article ...
Please Press that and Make me happy and Motivated...
0
sneha123's Avatar
Go4Expert Member
Quote:
Originally Posted by lionaneesh View Post
Thanks But ...
If you wanna really appreciate My work...
There is a 'THANKS' button just at the ending of the article ...
Please Press that and Make me happy and Motivated...
Ok,,,,,,,,I understand this,,,,,,,really thankful to you for reply my post,,,,,,,