Bug 1202663

Summary: dracut fails to remove older kernels when using the YaST upgrade option
Product: [openSUSE] openSUSE Tumbleweed Reporter: Luna Jernberg <droidbittin>
Component: YaST2Assignee: Michal Suchanek <msuchanek>
Status: REOPENED --- QA Contact: Jiri Srain <jsrain>
Severity: Minor    
Priority: P5 - None CC: bittin, dimstar, droidbittin
Version: CurrentFlags: msuchanek: needinfo? (droidbittin)
Target Milestone: ---   
Hardware: x86-64   
OS: Linux   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Luna Jernberg 2022-08-24 07:23:05 UTC
Hey!

I upgraded with the latest .iso today 
and dracut failed to remove the 5.19.1 and 5.19.0 kernel when i used the upgrade option in my Virtualbox VM but it worked to boot with kernel 5.19.2 but would be nice if the step to remove older unused kernels would work
Comment 1 Luna Jernberg 2022-08-24 16:45:56 UTC
Fixed with the 0823 iso *closing*
Comment 2 Luna Jernberg 2022-09-28 16:04:37 UTC
Had this happen again today with the 0926 ISO so opening again
Comment 3 Michal Filka 2022-09-29 05:52:21 UTC
For now nothing for yast. Reassining
Comment 4 Antonio Feijoo 2022-09-29 06:17:55 UTC
AFAIK, this feature was moved to the purge-kernels-service package. Reassigning.
Comment 5 Michal Suchanek 2022-09-29 06:53:47 UTC
purge-kernels service simply runs 

zypper purge-kernels

if a file exists.

cat /usr/lib/systemd/system/purge-kernels.service
[Unit]
Description=Purge old kernels
After=local-fs.target
ConditionPathExists=/boot/do_purge_kernels
ConditionPathIsReadWrite=/

[Service]
Type=exec
Nice=19
IOSchedulingClass=idle
Environment=ZYPP_LOCK_TIMEOUT=-1
ExecStart=/usr/bin/zypper -n purge-kernels
ExecStartPost=/bin/rm -f /boot/do_purge_kernels

[Install]
WantedBy=multi-user.target

What is the status of the service?

Do you have the file after doing the upgrade?

does running zypper purge-kernels remove the kernels?