This question already has an answer here:

Sick of checking this post page every X days, I really would like to solve my problem with the disk space and the Ubuntu updates. So, there is a way to automatize this process?

Not enough free disk space when upgrading

Of course I can create a script that does it, but would be awesome if the Ubuntu update center would have a config value like: Amount of Ubuntu images to keep in memory.

In my case, I would save only 1, always having the same amount of disk used, so free.

So, my question is: There is a native/automated solution that keeps the amount of images to certain number without any 'human' action? when a new one is installed, the last one is removed.

marked as duplicate by Jacob Vlijm, Eric Carvalho, Tim, JoKeR, Maythux Jul 1 '15 at 9:28

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • I have also same problem here – Madhav Nikam Jun 18 '15 at 14:30
  • Specifically, what is your question? If you just need to remove old kernels, you can install Ubuntu-tweak and run that after you install new ones. It can remove the cruft. – Organic Marble Jun 18 '15 at 16:14
  • Edited with a more clear question.@OrganicMarble, should I understand that Ubuntu Tweak have that functionality? – eMarine Jun 19 '15 at 6:54
  • Ubuntu Tweak can remove old kernels and other un-needed packages. But it doesn't do it automatically, and you really don't want it to. What if the new kernel has a bug? You need to be able to fall back to the old one. After you are happy that the new one is OK, you can delete the old one with Ubuntu Tweak. Some people keep a couple around just to be safe. – Organic Marble Jun 19 '15 at 16:55
  • Hi @OrganicMarble, thx u very much for your answer, I understand perfectly the case where the new one have a bug. But: Could be interesting to be able to define the amount of versions to keep, in this way, in my case, I would keep only one while someone that is more afraid could keep more. Another solution is not have any automatic update and update kernel after a while, when bugs are solved. (for example) In all cases, I understand there is no solution such I propose, so I'll propose in the forum, or maybe I'll do it by myself. – eMarine Jun 21 '15 at 12:45

Browse other questions tagged or ask your own question.