Fedora 32 - safely remove /var/cache/yum folder

I’m trying to tidy up a little bit my root folder and I realized the existence of the /var/cache/yum folder. It seems to me as a leftover from a previous version of Fedora (prior to the upgrade from yum to dnf) !
As far as I know, the dnf cache lives in /var/cache/dnf.
Is it safe to remove the /var/cache/yum ?

1 Like

It should be safe to remove.
But in general case you should preserve files/directories owned by packages:

for DIR in /var/cache/{dnf,yum}; \
do rpm -q -l $(rpm -q -f $(find "${DIR}") \
| grep -v -e "not owned by any package") \
| grep -e "${DIR}"; \

By the way, the recommended method that leaves some leftovers:

sudo dnf clean all
1 Like