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.

Giacomo1968
  • 55,001

2 Answers2

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

harrymc
  • 480,290
  • 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? – Steve Summit Jul 27 '22 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 Jul 27 '22 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. – Steve Summit Jul 27 '22 at 15:44
  • Keepcache should have been the solution. – harrymc Jul 27 '22 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! :-) ) – Steve Summit Jul 27 '22 at 15:47
  • Found another bug report behind a paywall. But see How to get free redhat subscription - you might follow the latter comments about getting a developer subscription. – harrymc Jul 27 '22 at 15:59
  • For the record: despite trying everything you and the linked web page suggested, the yum cache is still filling back up again daily. It always seems to be at about 1430 UTC, so I think I'm going to have to set up a cron job to do the rm -rf every day at 1500. (Pathetic? Most certainly.) Thanks for trying, though, I appreciate it. – Steve Summit Jul 28 '22 at 18:04
  • Here I come in about a year later and am having the same problem with my machine. Cache keeps filling up yum clean all fixes it but will fill up again and my keepcache is set to 0 also. This is frustrating as its on an old old web-server I never setup and some genius setup this machine with an 8GB / drive sigh. – Codejoy Sep 13 '23 at 20:57