In /boot
there are a lot of vmlinuz.*
files going back 4 years. Is it safe to remove some of these?
Edit: Most seem to have congig-3.*
and System.map.*
files to go with them. I would probably want to be rid of those too? Or instead?
In /boot
there are a lot of vmlinuz.*
files going back 4 years. Is it safe to remove some of these?
Edit: Most seem to have congig-3.*
and System.map.*
files to go with them. I would probably want to be rid of those too? Or instead?
They will be removed automatically if you run the following:
sudo apt-get autoremove
Update: I found a VM where I haven't run those commands in a few weeks. Here is the output, showing that autoremove
cleans up files in /boot, going from 127M in size down to 96M in size:
stephane@steph-dev-vm ~> du -hs /boot/
127M /boot/
stephane@steph-dev-vm ~> sudo apt-get install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
linux-headers-3.16.0-30 linux-headers-3.16.0-30-generic linux-image-3.16.0-30-generic
linux-image-extra-3.16.0-30-generic
Use 'apt-get autoremove' to remove them.
stephane@steph-dev-vm ~> sudo apt-get autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
linux-headers-3.16.0-30 linux-headers-3.16.0-30-generic linux-image-3.16.0-30-generic
linux-image-extra-3.16.0-30-generic
0 upgraded, 0 newly installed, 4 to remove and 0 not upgraded.
After this operation, 281 MB disk space will be freed.
Do you want to continue? [Y/n] y
...
Found linux image: /boot/vmlinuz-3.16.0-31-generic
Found initrd image: /boot/initrd.img-3.16.0-31-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
done
stephane@steph-dev-vm ~> du -hs /boot/
96M /boot/
autoremove
removes old automatically (e.g. as dependencies) installed packages which are no longer needed. clean
deletes all locally cached .deb files downloaded by apt-get. autoclean
does the same as clean
but deletes only those .deb files which are outdated (version not available on server any more). So autoclean
is included in clean
and both do not touch installed packages, just the cached .debs (call them installation files, if you want).
– Byte Commander
Apr 10 '15 at 15:31
The answer appears to be that there are lots of kernels installed and I should remove them.
I removed the oldest using sudo apt-get uninstall
and a wild card. Risky if you get it wrong but otherwise effective.
dpkg -S /usr/src/*
http://askubuntu.com/questions/301466/files-are-piling-up-in-usr-src-how-can-i-stop-this This with 14.04 is supposed to only keep 2 kernels, but not sure if working on my system. /etc/kernel/postinst.d/apt-auto-removal. – oldfred Apr 11 '15 at 15:15