hamwaves.com
;

Removing Old Kernels from /boot

Serge Y. Stroobandt

Copyright 2013–2016, licensed under Creative Commons BY-NC-SA

  1. Home
  2. Information Technology
  3. Removing Old Kernels

Introduction

Having a separate /boot partition different from the root partition may offer the advantage of faster booting, especially on spinning hard drives. Such a /boot partition is typically anywhere between 100 and 500MB in size. –I certainly prefer 500MB whenever possible.– However, there is also a disadvantage to this. As you keep your system up-to-date with upgrades, new kernels are installed while older kernels remain in place. If you are not careful, kernel images may eventually threaten to entirely fill up the  /boot partition.

Kernel version

First, check which kernel version you are currently running. It should be the latest kernel.

$ uname -r

Removing obsolete kernels

In Debian-derived distributions, removing obsolete kernels is really easy. The apt-get autoremove command will in most cases remove all but the two most recent kernels from a crammed /boot partition.

$ sudo apt-get autoremove

Manually purging kernels

It may happen that an installed kernel may no longer be removed by means of apt-get autoremove. This occurs when an older kernel version is no longer listed in the repository of a rolling Debian release. In such a case, you will need to purge the obsolete kernel manually.

$ sudo apt-get purge linux-headers-version-arch linux-image-version-arch
$ sudo rm \boot\*-version-arch
$ sudo dpkg-reconfigure grub-pc
5
Creative Commons Licence
This work is licensed under a Creative Commons Attribution‑NonCommercial‑ShareAlike 4.0 International License.
Other licensing available on request.
GNU GPL v3
Unless otherwise stated, all originally authored software on this site is licensed under the terms of GNU GPL version 3.
cookie
This static web site has no backend database.
Hence, no personal data is collected and GDPR compliance is met.
Moreover, this domain does not set any first party cookies.

All Google ads shown on this web site are, irrespective of your location,
restricted in data processing to meet compliance with the CCPA and GDPR.
However, Google AdSense may set third party cookies for traffic analysis and
use JavaScript to obtain a unique set of browser data.
Your browser can be configured to block third party cookies.
Furthermore, installing an ad blocker like EFF's Privacy Badger
will block the JavaScript of ads.
Google's ad policies can be found here.
This page employs a Python Bottle server‑side script.
This page includes an open-source client-side script, written in Python and
transcoded by Brython to make it run as secure JavaScript in the browser.
Static XHTML generated from Markdown by Pandoc and
the GNU/Linux make, sed and gpp commands.
LaTeXmath markup rendered with MathJax.
BibTeX references are best read with JabRef.
Unattended CSS typesetting with Prince.
This work is published at https://hamwaves.com/remove-kernels/en/.
profile for Serge Stroobandt on Stack Exchange, a network of free, community-driven Q&A sites
GnuPG
Use my OpenPGP public key to encrypt messages for:

echo c2VyZ2VAc3Ryb29iYW5kdC5jb20K |base64 -d
Last update: Wednesday, September 1, 2021.