a.k.a removing old kernel packages and rewriting new menu.lst
I have in the grub's menu list (/boot/grub/menu.lst) entries:
And in the /boot/
I wan't to remove the oldest (kernel 2.6.15-25-386)
Using Synaptic/Adept package manager:
Search 2.6.15-25-386:
--> Find:
linux-image-2.6.15-25-386
Linux kernel image for version 2.6.15 on 386.
Click Remove:
Synaptic tells (update-grub /1/ ):
After that (menu.lst):
and /boot/:
Note #1
If you just remove entries from the menu.lst they will be back when you update kernel next time.
Note #2
This makes new menu.lst.
/1/ man update-grub tells:
I have in the grub's menu list (/boot/grub/menu.lst) entries:
...
title Ubuntu, kernel 2.6.15-28-k7
title Ubuntu, kernel 2.6.15-28-k7 (recovery mode)
...
title Ubuntu, kernel 2.6.15-27-k7
title Ubuntu, kernel 2.6.15-27-k7 (recovery mode)
...
title Ubuntu, kernel 2.6.15-26-k7
title Ubuntu, kernel 2.6.15-26-k7 (recovery mode)
...
title Ubuntu, kernel 2.6.15-25-386
title Ubuntu, kernel 2.6.15-25-386 (recovery mode)
...
title Ubuntu, memtest86+
...
title Ubuntu, kernel 2.6.15-28-k7
title Ubuntu, kernel 2.6.15-28-k7 (recovery mode)
...
title Ubuntu, kernel 2.6.15-27-k7
title Ubuntu, kernel 2.6.15-27-k7 (recovery mode)
...
title Ubuntu, kernel 2.6.15-26-k7
title Ubuntu, kernel 2.6.15-26-k7 (recovery mode)
...
title Ubuntu, kernel 2.6.15-25-386
title Ubuntu, kernel 2.6.15-25-386 (recovery mode)
...
title Ubuntu, memtest86+
...
01 2005-10-25 13:32 memtest86+.bin
02 2006-06-14 14:24 config-2.6.15-25-386
03 2006-06-14 15:15 vmlinuz-2.6.15-25-386
04 2006-06-14 15:15 abi-2.6.15-25-386
05 2006-06-14 15:15 System.map-2.6.15-25-386
06 2006-06-29 23:13 initrd.img-2.6.15-25-386
07 2006-09-08 23:35 config-2.6.15-26-k7
08 2006-09-09 00:54 vmlinuz-2.6.15-26-k7
09 2006-09-09 00:54 abi-2.6.15-26-k7
10 2006-09-09 00:54 System.map-2.6.15-26-k7
11 2006-09-14 19:10 initrd.img-2.6.15-26-k7
12 2006-12-08 20:19 config-2.6.15-27-k7
13 2006-12-08 21:36 vmlinuz-2.6.15-27-k7
14 2006-12-08 21:36 abi-2.6.15-27-k7
15 2006-12-08 21:36 System.map-2.6.15-27-k7
16 2006-12-14 10:29 initrd.img-2.6.15-27-k7
17 2007-03-13 23:01 config-2.6.15-28-k7
18 2007-03-13 23:32 vmlinuz-2.6.15-28-k7
19 2007-03-13 23:32 abi-2.6.15-28-k7
20 2007-03-13 23:32 System.map-2.6.15-28-k7
21 2007-04-15 01:42 initrd.img-2.6.15-28-k7
02 2006-06-14 14:24 config-2.6.15-25-386
03 2006-06-14 15:15 vmlinuz-2.6.15-25-386
04 2006-06-14 15:15 abi-2.6.15-25-386
05 2006-06-14 15:15 System.map-2.6.15-25-386
06 2006-06-29 23:13 initrd.img-2.6.15-25-386
07 2006-09-08 23:35 config-2.6.15-26-k7
08 2006-09-09 00:54 vmlinuz-2.6.15-26-k7
09 2006-09-09 00:54 abi-2.6.15-26-k7
10 2006-09-09 00:54 System.map-2.6.15-26-k7
11 2006-09-14 19:10 initrd.img-2.6.15-26-k7
12 2006-12-08 20:19 config-2.6.15-27-k7
13 2006-12-08 21:36 vmlinuz-2.6.15-27-k7
14 2006-12-08 21:36 abi-2.6.15-27-k7
15 2006-12-08 21:36 System.map-2.6.15-27-k7
16 2006-12-14 10:29 initrd.img-2.6.15-27-k7
17 2007-03-13 23:01 config-2.6.15-28-k7
18 2007-03-13 23:32 vmlinuz-2.6.15-28-k7
19 2007-03-13 23:32 abi-2.6.15-28-k7
20 2007-03-13 23:32 System.map-2.6.15-28-k7
21 2007-04-15 01:42 initrd.img-2.6.15-28-k7
Using Synaptic/Adept package manager:
Search 2.6.15-25-386:
--> Find:
linux-image-2.6.15-25-386
Linux kernel image for version 2.6.15 on 386.
Click Remove:
Synaptic tells (update-grub /1/ ):
Removing linux-image-2.6.15-25-386 ...
Searching for GRUB installation directory ... found: /boot/grub
Testing for an existing GRUB menu.list file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found kernel: /boot/vmlinuz-2.6.15-28-k7
Found kernel: /boot/vmlinuz-2.6.15-27-k7
Found kernel: /boot/vmlinuz-2.6.15-26-k7
Found kernel: /boot/memtest86+.bin
Updating /boot/grub/menu.lst ... done
Purging configuration files for linux-image-2.6.15-25-386 ...
Searching for GRUB installation directory ... found: /boot/grub
Testing for an existing GRUB menu.list file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found kernel: /boot/vmlinuz-2.6.15-28-k7
Found kernel: /boot/vmlinuz-2.6.15-27-k7
Found kernel: /boot/vmlinuz-2.6.15-26-k7
Found kernel: /boot/memtest86+.bin
Updating /boot/grub/menu.lst ... done
Cannot delete /boot/initrd.img-2.6.15-25-386, doesn't exist.
Searching for GRUB installation directory ... found: /boot/grub
Testing for an existing GRUB menu.list file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found kernel: /boot/vmlinuz-2.6.15-28-k7
Found kernel: /boot/vmlinuz-2.6.15-27-k7
Found kernel: /boot/vmlinuz-2.6.15-26-k7
Found kernel: /boot/memtest86+.bin
Updating /boot/grub/menu.lst ... done
Purging configuration files for linux-image-2.6.15-25-386 ...
Searching for GRUB installation directory ... found: /boot/grub
Testing for an existing GRUB menu.list file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found kernel: /boot/vmlinuz-2.6.15-28-k7
Found kernel: /boot/vmlinuz-2.6.15-27-k7
Found kernel: /boot/vmlinuz-2.6.15-26-k7
Found kernel: /boot/memtest86+.bin
Updating /boot/grub/menu.lst ... done
Cannot delete /boot/initrd.img-2.6.15-25-386, doesn't exist.
After that (menu.lst):
...
title Ubuntu, kernel 2.6.15-28-k7
title Ubuntu, kernel 2.6.15-28-k7 (recovery mode)
...
title Ubuntu, kernel 2.6.15-27-k7
title Ubuntu, kernel 2.6.15-27-k7 (recovery mode)
...
title Ubuntu, kernel 2.6.15-26-k7
title Ubuntu, kernel 2.6.15-26-k7 (recovery mode)
...
title Ubuntu, memtest86+
...
title Ubuntu, kernel 2.6.15-28-k7
title Ubuntu, kernel 2.6.15-28-k7 (recovery mode)
...
title Ubuntu, kernel 2.6.15-27-k7
title Ubuntu, kernel 2.6.15-27-k7 (recovery mode)
...
title Ubuntu, kernel 2.6.15-26-k7
title Ubuntu, kernel 2.6.15-26-k7 (recovery mode)
...
title Ubuntu, memtest86+
...
01 2005-10-25 13:32 memtest86+.bin
02 2006-09-08 23:35 config-2.6.15-26-k7
03 2006-09-09 00:54 vmlinuz-2.6.15-26-k7
04 2006-09-09 00:54 abi-2.6.15-26-k7
05 2006-09-09 00:54 System.map-2.6.15-26-k7
06 2006-09-14 19:10 initrd.img-2.6.15-26-k7
07 2006-12-08 20:19 config-2.6.15-27-k7
08 2006-12-08 21:36 vmlinuz-2.6.15-27-k7
09 2006-12-08 21:36 abi-2.6.15-27-k7
10 2006-12-08 21:36 System.map-2.6.15-27-k7
11 2006-12-14 10:29 initrd.img-2.6.15-27-k7
12 2007-03-13 23:01 config-2.6.15-28-k7
13 2007-03-13 23:32 vmlinuz-2.6.15-28-k7
14 2007-03-13 23:32 abi-2.6.15-28-k7
15 2007-03-13 23:32 System.map-2.6.15-28-k7
16 2007-04-15 01:42 initrd.img-2.6.15-28-k7
02 2006-09-08 23:35 config-2.6.15-26-k7
03 2006-09-09 00:54 vmlinuz-2.6.15-26-k7
04 2006-09-09 00:54 abi-2.6.15-26-k7
05 2006-09-09 00:54 System.map-2.6.15-26-k7
06 2006-09-14 19:10 initrd.img-2.6.15-26-k7
07 2006-12-08 20:19 config-2.6.15-27-k7
08 2006-12-08 21:36 vmlinuz-2.6.15-27-k7
09 2006-12-08 21:36 abi-2.6.15-27-k7
10 2006-12-08 21:36 System.map-2.6.15-27-k7
11 2006-12-14 10:29 initrd.img-2.6.15-27-k7
12 2007-03-13 23:01 config-2.6.15-28-k7
13 2007-03-13 23:32 vmlinuz-2.6.15-28-k7
14 2007-03-13 23:32 abi-2.6.15-28-k7
15 2007-03-13 23:32 System.map-2.6.15-28-k7
16 2007-04-15 01:42 initrd.img-2.6.15-28-k7
Note #1
If you just remove entries from the menu.lst they will be back when you update kernel next time.
Note #2
This makes new menu.lst.
/1/ man update-grub tells:
update-grub - program to generate GRUB’s menu.lst file
DESCRIPTION
update-grub is a program used to generate the menu.lst file used by the
grub bootloader. It works by looking in /boot for all files which
start with "vmlinuz-". They will be treated as kernels, and grub menu
entries will be created for each. It will also create the initial
menu.lst if none exists, after prompting the user. It will also add
initrd lines for ramdisk images found with the same version as kernels
found.
DESCRIPTION
update-grub is a program used to generate the menu.lst file used by the
grub bootloader. It works by looking in /boot for all files which
start with "vmlinuz-". They will be treated as kernels, and grub menu
entries will be created for each. It will also create the initial
menu.lst if none exists, after prompting the user. It will also add
initrd lines for ramdisk images found with the same version as kernels
found.
Comment