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.

Sorry if the title is not very clear. This is rather new to me.

I have ran this 10.04.4 LTS server for over a year now. I have dutifully used aptitude update / aptitude upgrade on a regular basis then rebooted my server when advised to do so.

Today I was warned that /boot was running out of space. So I started looking into the removal of old kernels.

$uname -r  
2.6.32-38-server  

Then I looked at /boot and found that I had more recent versions of the kernel

-rw-r--r-- 1 root root 8547102 Dec 22  2011 /boot/initrd.img-2.6.32-37-server  
-rw-r--r-- 1 root root 8535914 Jan 25  2012 /boot/initrd.img-2.6.32-38-server  
-rw-r--r-- 1 root root 8539717 Mar 20  2012 /boot/initrd.img-2.6.32-39-server  
-rw-r--r-- 1 root root 8538788 Apr 10  2012 /boot/initrd.img-2.6.32-40-server  
-rw-r--r-- 1 root root 8538887 Aug 11  2012 /boot/initrd.img-2.6.32-41-server  
-rw-r--r-- 1 root root 8546431 Oct  5  2012 /boot/initrd.img-2.6.32-42-server  
-rw-r--r-- 1 root root 8545858 Oct  5  2012 /boot/initrd.img-2.6.32-43-server  
-rw-r--r-- 1 root root 8545789 Oct 14  2012 /boot/initrd.img-2.6.32-44-server  
-rw-r--r-- 1 root root 8547103 Feb 24 11:25 /boot/initrd.img-2.6.32-45-server  
-rw-r--r-- 1 root root 8546521 Apr 19 06:55 /boot/initrd.img-2.6.32-46-server  
-rw-r--r-- 1 root root 8545660 May 15 06:41 /boot/initrd.img-2.6.32-47-server  

This is confirmed by dpkg

$ dpkg -l | grep linux-image  
ii  linux-image-2.6.32-37-server     2.6.32-37.81                      Linux kernel image for version 2.6.32 on x86  
ii  linux-image-2.6.32-38-server     2.6.32-38.83                      Linux kernel image for version 2.6.32 on x86  
ii  linux-image-2.6.32-39-server     2.6.32-39.86                      Linux kernel image for version 2.6.32 on x86  
ii  linux-image-2.6.32-40-server     2.6.32-40.87                      Linux kernel image for version 2.6.32 on x86  
ii  linux-image-2.6.32-41-server     2.6.32-41.94                      Linux kernel image for version 2.6.32 on x86  
ii  linux-image-2.6.32-42-server     2.6.32-42.96                      Linux kernel image for version 2.6.32 on x86  
ii  linux-image-2.6.32-43-server     2.6.32-43.97                      Linux kernel image for version 2.6.32 on x86  
ii  linux-image-2.6.32-44-server     2.6.32-44.98                      Linux kernel image for version 2.6.32 on x86  
ii  linux-image-2.6.32-45-server     2.6.32-45.104                     Linux kernel image for version 2.6.32 on x86  
ii  linux-image-2.6.32-46-server     2.6.32-46.108                     Linux kernel image for version 2.6.32 on x86  
ii  linux-image-2.6.32-47-server     2.6.32-47.109                     Linux kernel image for version 2.6.32 on x86  
ii  linux-image-server               2.6.32.47.54                      Linux kernel image on Server Equipment.  

/boot/grub/grub.cfg has only one entry (menu?)

### BEGIN /etc/grub.d/10_linux ###  
    menuentry 'Ubuntu, with Linux 2.6.32-38-server' --class ubuntu --class gnu-linux --class gnu --class os {  
    recordfail  
    insmod ext2  
    set root='(hd0,1)'  
    search --no-floppy --fs-uuid --set f2ed5eb3-d3e5-4cc2-b45d-7190337be222  
    linux   /vmlinuz-2.6.32-38-server root=UUID=1cdc82de-7361-47f3-aeda-21b6929ef256 ro   quiet splash  
    initrd  /initrd.img-2.6.32-38-server  
}  

I'd like your advice on how I can get 'aptitude upgrade' to update grub. I could also use some pointers as to how to cleanup some of this mess.

I found some posts that each seems to solve a piece of the puzzle. I'm a bit reluctant to try anything as my server is headless and remote (colo).

share|improve this question

2 Answers 2

Does How to reinstall a apt-get dist-upgrade? help?

Also, deleting the newest kernel package (as mentioned in the link) and performing a sudo apt-get dist-upgrade again may help, once you've cleared space.

share|improve this answer
    
Dunno! I'm reluctant to try things until I understand how this stuff is supposed to work (grub ...). Maybe it's dead simple, but fixing a remote headless server that won't boot is a pain. Thanks for the pointer though. –  Pierre Leblanc-André May 16 '13 at 14:29
    
Well, you can safely delete unused packages. You have a working config. You shouldn't need to touch grub, and by removing a few for space (including the new one that's not installed properly), and reinstalling the newest one, you should be okay? –  lunistorvalds May 16 '13 at 14:47

Turned out to be dead simple.

$update-grub

found the newer kernels and set the latest one as the default.

Now all I have to do is remove the old ones.

Plenty on documentation on that subject.

Thanks for all the pointer.

share|improve this answer

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.