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.

I have a server which is running ubuntu with automatic security updates, /boot is now nearly full (93%). Below is the output of dpkg -l "linux-image*"

 ii  linux-image-3.2.0-24-generic                    3.2.0-24.39                                     Linux kernel image for version 3.2.0 on 64 bit x86 SMP
ii  linux-image-3.2.0-36-generic                    3.2.0-36.57                                     Linux kernel image for version 3.2.0 on 64 bit x86 SMP
ii  linux-image-3.2.0-37-generic                    3.2.0-37.58                                     Linux kernel image for version 3.2.0 on 64 bit x86 SMP
ii  linux-image-3.2.0-38-generic                    3.2.0-38.61                                     Linux kernel image for version 3.2.0 on 64 bit x86 SMP
ii  linux-image-3.2.0-39-generic                    3.2.0-39.62                                     Linux kernel image for version 3.2.0 on 64 bit x86 SMP
ii  linux-image-3.2.0-40-generic                    3.2.0-40.64                                     Linux kernel image for version 3.2.0 on 64 bit x86 SMP
ii  linux-image-3.2.0-41-generic                    3.2.0-41.66                                     Linux kernel image for version 3.2.0 on 64 bit x86 SMP 
ii  linux-image-3.2.0-43-generic                    3.2.0-43.68                                     Linux kernel image for version 3.2.0 on 64 bit x86 SMP
ii  linux-image-3.2.0-44-generic                    3.2.0-44.69                                       Linux kernel image for version 3.2.0 on 64 bit x86 SMP
iF  linux-image-3.2.0-45-generic                    3.2.0-45.70                                     Linux kernel image for version 3.2.0 on 64 bit x86 SMP
iF  linux-image-3.2.0-48-generic                    3.2.0-48.74                                     Linux kernel image for version 3.2.0 on 64 bit x86 SMP
iU  linux-image-server                              3.2.0.48.58                                     Linux kernel image on Server Equipment.

The server is currently running on 3.2.0-24-generic

 #uname -r 
 3.2.0-24-generic

So my question is can i remove the images inbetween the latest and the running one safely ?

apt-get purge linux-image-3.2.0-36-generic linux-image-3.2.0-37-generic linux-image-3.2.0-38-generic linux-image-3.2.0-39-generic linux-image-3.2.0-40-generic linux-image-3.2.0-41-generic linux-image-3.2.0-43-generic linux-image-3.2.0-44-generic

I understand that i ideally need to reboot the server to bring it up to the latest and then i can clean up the rest but finding a time to reboot with the client is proving .... dificult

Thanks guys :-)

share|improve this question

2 Answers 2

up vote 3 down vote accepted

Yes, you can un-install all kernel+header packages, except the currently running kernel+header. This is fine even though you might not have ever booted into those kernels. There are no cross-dependencies between the different kernel packages. Each kernel package only has dependencies for it's own version.

So, if you are currently using the "3.2.0-24-generic" version, I would advise you to remove the following kernel packages and the corresponding "linux-headers" packages:

linux-image-3.2.0-36-generic
linux-image-3.2.0-37-generic
linux-image-3.2.0-38-generic
linux-image-3.2.0-39-generic
linux-image-3.2.0-40-generic
linux-image-3.2.0-41-generic
linux-image-3.2.0-43-generic
linux-image-3.2.0-44-generic

I always keep at least two older kernels, in case I ever need to go back.

share|improve this answer
    
Ok thank you :-) –  Tim Lassie Freeborn Jul 2 '13 at 14:28

yes, you can safely uninstall old/unused kernels (images+headers), and this can free up a significant amount of disk space in some cases.

make sure to keep the currently used kernel and perhaps some older ones should you ever find the need to boot an older kernel because of a regression.

share|improve this answer
    
Ok I know i can remove them, the question is can i remove the kernels and headers for a kernel which i have never used. The server is on the same kernel as it was when it deployed because it has never been rebooted. Is it safe to remove kernels that have been automatically downloaded but never booted or is there likely to be dependencies relying on them even though they were never booted from ? –  Tim Lassie Freeborn Jul 2 '13 at 13:55
    
sorry, somehow i was too fast. i withdraw my answer. –  mnagel Jul 2 '13 at 13:59

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.