It mentioned both.chat GPT is a little out of date
Redhat 8 and 9 use dnf. The yum commands will still work, supposedly they will be deprecated in redhat 10.
But the yum command is just a link back to dnf. But yes, dnf has autoremove,.
The OP isn't about Linux Mint, but about Rocky Linux.In Linux Mint Cinnamon you can remove old Kernels automatically by enabling this..
The OP isn't about Linux Mint, but about Rocky Linux.