Delete old kernels

  • Hi,


    I would like to delete some old kernels on my system, leave the current one and one more for safety.
    What is the recommended procedure?.


    The kernels that I have installed are the following:

    Code
    linux-image-5.10.0-0.bpo.3-amd64
    linux-image-5.10.0-0.bpo.4-amd64
    linux-image-5.10.0-0.bpo.5-amd64
    linux-image-5.4.0-0.bpo.4-amd64
    linux-image-5.6.0-0.bpo.2-amd64
    linux-image-5.7.0-0.bpo.2-amd64
    linux-image-5.8.0-0.bpo.2-amd64
    linux-image-5.9.0-0.bpo.2-amd64
    linux-image-5.9.0-0.bpo.5-amd64
    linux-image-amd64

    Thank.

  • shishio

    Hat das Label gelöst hinzugefügt.
    • Offizieller Beitrag

    I've found that apt --purge autoremove does nothing for old kernels on my server.

    This is the case, if a kernel is marked as manually installed. Then you have to manually uninstall them as well.

    • Offizieller Beitrag

    backports kernels are different packages. autoremove will only remove them when they are still associated with the meta package (linux-image-amd64). Once a new version is released (6.1 over 6.0), the association to the older package is lost. So, they will need to be removed manually.

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.6 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

    • Offizieller Beitrag

    dpkg -l |grep linux-image Will get you a list like in the first post. You can tell if they are still installed if it has "ii". If it is uninstalled it will show "rc" or something else cant remember of the top of my head. Removing the "rc" is only cosmetic they have been mostly removed.


    Don't remove "linux-image-and64". apt remove --purge linux-image-5.9.0-0.bpo.5-amd64 (others you want to remove) Will clean up the list and give you back a bunch of disk space. Keep the last two just in case.

    • Offizieller Beitrag

    If it is uninstalled it will show "rc" or something else cant remember of the top of my head. Removing the "rc" is only cosmetic they have been mostly removed.

    It means "removed" but the config is still there. If you purge it, it will be completely gone. I always recommend purging.

    apt remove --purge linux-image-5.9.0-0.bpo.5-amd64 (others you want to remove) Will clean up the list and give you back a bunch of disk space. Keep the last two just in case.

    The kernel plugin allows you to do this. It shouldn't let you remove the running kernel either

  • Hi everyone, I did recently in-place, on-device OMV upgrade from 5.x to 6.x and by chance discovered that in my folder /lib/modules/ I still had old stuff hanging around (I installed WireGuard and wanted to see what's inside that folder mentioned in the config).


    I didapt autoremove it removed 0 bytes.


    I thus had to resort to manual uninstall, then, per gderf post and instructions:

    How to Delete Old Unused Kernels in Debian and Ubuntu
    In this article, we will explain how to safely delete old unused kernels in Debian and Ubuntu systems, but before removing first install latest kernel version.
    www.tecmint.com

    Question, please. If you see my full log above (at the end) with the 6.1.0.x kernels left, there remains one image with a very generic name linux-image-amd64 is this from the installer etc. ? Can it be erased ? Is the the default image (backup) ?


    Thank you.

    OpenMediaVault 6.9.13-1 • Intel NUC NUC6CAYH • Intel Celeron J3455 • 2x4GB RAM • Samsung 870 QVO 4TB • USB Boot (System)

    • Offizieller Beitrag

    there remains one image with a very generic name linux-image-amd64 is this from the installer etc. ? Can it be erased ? Is the the default image (backup) ?

    linux-image-amd64 should not be removed. It is a meta package that points at the latest kernel package. If you remove it, you would have to manually install kernel updates.

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.6 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!