
Show HN: Purge old kernels and headers on Linux using apt-get - jph
Hacker News today features an Ubuntu story with sysadmins asking how to purge old kernels and headers by using apt. This is necessary maintenance on some systems because &#x2F;boot fills up.<p>Here&#x27;s how we do it:<p><pre><code>    apt-get remove --purge &#x27;linux-image-[0-9].*&#x27; linux-image-$(uname -r)+

    apt-get remove --purge &#x27;linux-headers-[0-9].*&#x27; linux-headers-$(uname -r)+
</code></pre>
Complete script with comments here; we welcome feedback and also pull requests.<p>https:&#x2F;&#x2F;github.com&#x2F;SixArm&#x2F;sixarm_apt_scripts&#x2F;blob&#x2F;master&#x2F;apt-purge-old-kernels-and-headers
======
vientos
apt-get autoremove does the same and it's built into Ubuntu

