Can we clean yum cache files manually?

Super User Asked on November 7, 2020

I am using Redhat 7 while running yum update I am getting Bus error (core dumped) error.

After troubleshooting I found that / was full because of /var/cache/yum/x86_64/7server/rhel-x86_64-server-7/gen folder.

Inside this folder below files contains GB of data.

enter image description here

I tried yum clean all command to clean up the space but it is not working.

Can I manually delete these files?

Manual delete will cause any problem to yum ?

2 Answers

After successful installation, packages should be deleted from the yum cache. You should check in the file /etc/yum.conf, whether the keepcache setting is 1 instead of 0.

The RedHat post Maybe you want: rm -rf /var/cache/yum says that the command yum clean all gives the impression that enabled and disabled/removed repos are cleaned but in reality, performs only these tasks:

  • clean all cache from enabled repos
  • remove all data from unknown repos
  • preserve cache of disabled/removed repos

The fix in RHBA-2017:2295 should have added a reminder for this command saying:

Maybe you want: rm -rf /var/cache/yum, to also free up space taken by orphaned data from disabled or removed repos

In any case, whatever your situation, you can issue the recommended command:

rm -rf /var/cache/yum

Correct answer by harrymc on November 7, 2020

Manual deletion is quite safe and will not cause problems with yum. This is fine:

rm -rf /var/cache/yum

You can also check this post on other steps that may help in clearing disk space.

Answered by Danila Vershinin on November 7, 2020

Add your own answers!

Related Questions

Working in multiple languages/locales

2  Asked on November 3, 2021 by federico-nafria


Issues with UEFI: Can’t save settings and can’t boot OS automatically

2  Asked on November 3, 2021 by devank-mishra


Thinkpad X30 middle-click

4  Asked on November 3, 2021 by ian93


windows 10: Weird mouse movement (jumping and circle seen)

2  Asked on November 3, 2021 by user1480864


How to disable WSL password?

1  Asked on November 3, 2021


What to do when I need more keys than my keyboard has?

13  Asked on November 3, 2021 by carlanthony-zasowski


Ask a Question

Get help from others!

© 2022 All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP, SolveDir