LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   /var/cache/yum and /var/lib/rpm getting BIG. How to safely pare down? (https://www.linuxquestions.org/questions/linux-general-1/var-cache-yum-and-var-lib-rpm-getting-big-how-to-safely-pare-down-931641/)

SharpyWarpy 02-27-2012 07:34 PM

/var/cache/yum and /var/lib/rpm getting BIG. How to safely pare down?
 
I'm getting directories -- GROWING directories that I want to pare down if I can do so safely. I have Fedora 16 64 bit and it's using 7.0gb of space. /var/cache/yum and /var/lib/rpm are using 223mb and 125mb respectively and growing. My HDD is 14gb total. I know, I'm old and paranoid and probably shouldn't worry about it but I came through an age when 120mb HDDs were relatively large and I constantly cleaned stuff out just to keep the drive with plenty of space. Old habits die hard. I hope to clear out some other stuff after this if I can find it. Thanks ahead of time.

EricTRA 02-27-2012 11:49 PM

Hello,

If you want to clean out 'old' yum data you can just run:
Code:

yum clean all
That'll delete all downloaded packages from previous installations. It doesn't affect your installation, just cleans up the cache by deleting all downloaded packages. The /var/lib/rpm contains the RPM database and info so I advice you not to mess with it. That database holds all information the RPM command has about your system, installed packages, etc...

Kind regards,

Eric

SharpyWarpy 02-28-2012 07:12 PM

Quote:

Originally Posted by EricTRA (Post 4613718)
Hello,

If you want to clean out 'old' yum data you can just run:
Code:

yum clean all
That'll delete all downloaded packages from previous installations. It doesn't affect your installation, just cleans up the cache by deleting all downloaded packages. The /var/lib/rpm contains the RPM database and info so I advice you not to mess with it. That database holds all information the RPM command has about your system, installed packages, etc...

Kind regards,

Eric

Okay thanks a lot. Does "yum clean all" delete /var/lib/rpm?

EricTRA 02-29-2012 01:17 AM

Hi,

AFAIK it doesn't do anything with the rpm database, it only removes packages, headers, metadata and cleans out the sqlite database that yum uses. Have a look at the man page for yum for more detailed information. That for the yum part. If you want to 'clean up' your rpm database to make sure no 'old' references might be hanging around you can follow the following procedure:

- Move the existing database files /var/lib/rpm/_db* to another location for backup
- run the command:
Code:

rpm --rebuilddb
But under normal circumstances the rpm database occupies very little space and unless your having issues with the rpm related commands and assume a database corruption, there is no need at all to perform the above actions. After all 125 Mb is not large at all nowadays.

Kind regards,

Eric


All times are GMT -5. The time now is 12:50 AM.