LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   zypper update makes /var/lib/rpm/Packages grow and grow and grow... (https://www.linuxquestions.org/questions/linux-general-1/zypper-update-makes-var-lib-rpm-packages-grow-and-grow-and-grow-886617/)

Earl3 06-15-2011 07:33 PM

zypper update makes /var/lib/rpm/Packages grow and grow and grow...
 
Each time I run "zypper update" on a SUSE 11.1 server it causes /var/lib/rpm/Packages to grow by a few KB even though there are no new updates. Since a cron runs this a couple of times a day the file is almost 400MB on one of my servers. I'd like to shrink the file back to a reasonable size before I run out of space on my /var partition, so I ran this:

# zypper clean --all
# rpmdb --rebuilddb

Any suggestions on how to shrink /var/lib/rpm/Packages?

... but that had no effect. Here's what it looks like at the moment when I run "zypper update: manually:

[00:26:36] # ls -al /var/lib/rpm/Packages
-rw-r--r-- 1 root root 391577600 2011-06-16 00:22 /var/lib/rpm/Packages

[00:26:46] # zypper update
Loading repository data...
Reading installed packages...
Nothing to do.

[00:27:23] # ls -al /var/lib/rpm/Packages
-rw-r--r-- 1 root root 391593984 2011-06-16 00:27 /var/lib/rpm/Packages

[00:27:28] # zypper update
Loading repository data...
Reading installed packages...
Nothing to do.

[00:29:28] # ls -al /var/lib/rpm/Packages
-rw-r--r-- 1 root root 391610368 2011-06-16 00:29 /var/lib/rpm/Packages

andrewthomas 06-16-2011 12:16 AM

If you really think that you have something funny going on, you can back up the files, then rebuild from scratch.

Have you tried to back up the /var/lib/rpm directory then

Code:

rpm --initdb
rpm --rebuilddb


If that fails, then this is a link to a more complex procedure.

http://www.informatimago.com/linux/rpm-rebuilddb.html

Earl3 06-27-2011 11:29 AM

The problem appears to be affecting a number of different servers running OpenSUSE 11.1. I tried the same thing on an OpenSUSE 11.4 server and did not have the problem.

The problem is not causing any errors, just using an excessive amount of /var volume space, and the servers are scheduled to be upgraded to 11.4 (bare metal upgrade), so I think I'm going to leave this alone for now and let the upgrade solve the problem for me.

Thanks for the pointer to the detailed rebuild script. If zypper starts spewing errors I'll try that fix.

andrewthomas 06-27-2011 02:07 PM

Quote:

Originally Posted by Earl3 (Post 4397041)
The problem is not causing any errors, just using an excessive amount of /var volume space, and the servers are scheduled to be upgraded to 11.4 (bare metal upgrade), so I think I'm going to leave this alone for now and let the upgrade solve the problem for me.

Probably a good idea.

Quote:

Originally Posted by Earl3 (Post 4397041)
Thanks for the pointer to the detailed rebuild script. If zypper starts spewing errors I'll try that fix.

You're welcome.


All times are GMT -5. The time now is 08:20 PM.