Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

When I'm running update-grub get following output:

Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.5.0-26-generic
Found initrd image: /boot/initrd.img-3.5.0-26-generic
Found linux image: /boot/vmlinuz-3.5.0-25-generic
Found initrd image: /boot/initrd.img-3.5.0-25-generic
Found linux image: /boot/vmlinuz-3.5.0-17-generic
Found initrd image: /boot/initrd.img-3.5.0-17-generic
Found memtest86+ image: /boot/memtest86+.bin
done

Why are there three images listed?

I've read "grub shows same linux image twice" too. This hasn't solved my problem.


Content of my /etc/grub.d/ is:

$ ls -l
-rwxr-xr-x 1 root root  7541 okt 14 19:36 00_header
-rwxr-xr-x 1 root root  5488 okt  4 11:30 05_debian_theme
-rwxr-xr-x 1 root root 10891 okt 14 19:36 10_linux
-rwxr-xr-x 1 root root 10258 okt 14 19:36 20_linux_xen
-rwxr-xr-x 1 root root  1688 okt 11 16:10 20_memtest86+
-rwxr-xr-x 1 root root 10976 okt 14 19:36 30_os-prober
-rwxr-xr-x 1 root root  1426 okt 14 19:36 30_uefi-firmware
-rwxr-xr-x 1 root root   214 okt 14 19:36 40_custom
-rwxr-xr-x 1 root root   216 okt 14 19:36 41_custom
-rw-r--r-- 1 root root   483 okt 14 19:36 README
share|improve this question
    
where is three times? I see different kernel images.. 17, 25 & 26. Newer kernels get installed on updating the system. –  Web-E Apr 1 '13 at 12:59
    
My fault, rephrasing.. I meant why 3 images are listed. –  Frederik Spang Apr 1 '13 at 13:01
add comment

1 Answer

I was able to find this by some googling:

current=`uname -r` && uninstall="" && for version in `dpkg -l linux-image* | grep ii | awk '{ print $2}'`; do if [[ "$version" < "linux-image-$current" ]]; then uninstall=$uninstall" $version"; fi; done && sudo apt-get purge $uninstall -y && sudo update-grub2

It removes old kernels and updates grub. This solved my problem.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.