2

I have a RHEL system whose disk keeps filling up. The problem is /var/cache/yum. I have read Can we clean yum cache files manually? and I know that sometimes you have to, like it says, clear out /var/cache/yum manually.

My problem is that, a few hours after I manually clear it, the cache fills right back up again. (This is a particular problem because it's a VM with a small disk, and a full yum cache pegs it at 100%.)

Obviously some background process is helpfully repopulating the cache for me, but I can't figure out what it is.

A google search found https://access.redhat.com/solutions/5302591 which looks like it's probably my problem, but it's a subscriber-only page which I can't read. (Splendidly played customer blackmail tactic there, Red Hat.)

A google search found https://www.thegeekdiary.com/var-cache-yum-constantly-filling-files-system-in-centos-rhel/ , but it hasn't helped. It mentions a number of services to investigate, but none of those services seems to be running on my machine at all.


Update: I caught the mystery cache-filling process in the act. ps reveals that the process

/usr/bin/python /usr/share/PackageKit/hlpers/yum/yumBackend.

is running, invoked by /usr/libexec/packagekitd. And it looks like there's a systemd service 'packagekit' running. Anybody know what that is? I think I'll try disabling it.

2 Answers 2

1

I have discovered that the process that regularly fills up my disk is something called "packagekit". And I have discovered that I can stop/disable this process with one or both of the commands

systemctl stop packagekit
systemctl disable packagekit

Unfortunately this is not a permanent fix. For some as-yet unknown reason, packagekit automatically reenables itself after a few days, so my disk fills up again. If I find out a way to, like, actually disable it permanently, I'll post that here. (Otherwise I'm thinking I may have to delete this packagekit thing entirely.)

0

By default yum retains the packages and package data files that it downloaded, so they may be reused in future operations without being downloaded again.

This feature can be turned off by modifying the file /etc/yum.conf and changing the option keepcache to 0. Keepcache when set to 0 removes packages after installation.

Setting keepcache to 1 instructs yum to keep the cache of headers and packages after a successful installation.

To clean the cache, use the commands :

# yum clean all
# yum clean metadata

Source : /var/cache/yum Constantly Filling Files System in CentOS/RHEL

8
  • 1
    I have had keepcache set to 0 since the beginning, so I'm reasonably sure that's not my problem. When you wrote clean all, I assume you meant yum clean all? Commented Jul 27, 2022 at 15:32
  • Yes, I mis-typed. The keepcache fix should have worked, but see if one of the other advice in my link suits better your case.
    – harrymc
    Commented Jul 27, 2022 at 15:42
  • I tried the two yum clean commands. I won't know for 24 hours if they worked, because that's how long it's been taking for the mystery autorepopulation to occur. Commented Jul 27, 2022 at 15:44
  • Keepcache should have been the solution.
    – harrymc
    Commented Jul 27, 2022 at 15:45
  • I thought so, too. But there's something weird about this system. (Which is why I'm having to ask questions about it on Super User! :-) ) Commented Jul 27, 2022 at 15:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .