1

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 :-)

2 Answers 2

3

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.

0
1

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.

2
  • 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 ? Jul 2, 2013 at 13:55
  • sorry, somehow i was too fast. i withdraw my answer.
    – mnagel
    Jul 2, 2013 at 13:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .