SUSE Support

Here When You Need Us

Multiversion kernel package handling with 'purge-kernel.service'

This document (000021728) is provided subject to the disclaimer at the end of this document.

Environment

SUSE Linux Enterprise Server 15
SUSE Linux Enterprise Server 12


Situation

Updating or installing kernel packages increases file system usage.

 

Resolution

The systemd service 'purge-kernel.service" needs to be installed and enabled (which is the default for a new installation).

To enable:

# systemctl enable purge-kernel.service


The config file /etc/zypp/zypp.conf should contain the following lines (default for a fresh install - see comments in config file):

multiversion = provides:multiversion(kernel)
multiversion.kernels = latest,latest-1,running


After a reboot, kernels exceeding configured numbers will be purged.

If a reboot is not possible, the cleanup can be performed manually by executing:

# systemctl start purge-kernel.service

Note that the purge will only happen if the trigger file 'do_purge_kernels' is present in the /boot directory.

Cause

If old kernel packages are not removed, this may cause the boot partition to fill up, leading to operational problems.

 

Additional Information

On SLES15.x, the systemd purge-kernel.service is made available by installing the package purge-kernels-service. The package is found in the Basesystem repo.

On SLES12.x, the systemd purge-kernel.service is made available by the package dracut, which should be installed by default.

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:000021728
  • Creation Date: 04-Mar-2025
  • Modified Date:31-Jul-2025
    • SUSE Linux Enterprise Server
    • SUSE Linux Enterprise Server for SAP Applications

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

tick icon

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

tick icon

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

tick icon

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.