Merge "Revert "Use rpm -e instead of dnf for cleaning old kernels""

This commit is contained in:
Zuul 2022-02-09 07:50:24 +00:00 committed by Gerrit Code Review
commit b713c7fe6c
2 changed files with 1 additions and 9 deletions

View File

@ -18,7 +18,7 @@ if [[ ${YUM} == "dnf" ]]; then
# http://dnf.readthedocs.org/en/latest/cli_vs_yum.html
_old_kernels="$(dnf repoquery --installonly --latest-limit=-1 -q)"
if [[ -n "${_old_kernels}" ]]; then
rpm -e ${_old_kernels}
dnf remove -y --setopt=protect_running_kernel=False ${_old_kernels}
fi
else
install-packages yum-utils

View File

@ -1,8 +0,0 @@
---
fixes:
- |
Fixed an issue where cleaning old kernels on systems runing ``dnf`` would
fail in case the kernel packages being removed matches the running kernel
of the system building the image. See Bug: `1623409
<https://bugs.launchpad.net/diskimage-builder/+bug/1623409>`_.