Error building the cache for Plain RPM files: how to fix?

Hi,

On Tumbleweed for some bizarre reason I keep getting the error:


Error building the cache:
|] Failed to cache repo (1).
Target initialization failed:
Failed to cache rpm database (130).

whenever I try to install a local RPM package with zypper. Just now when I tried to install VirtualBox with zypper I got the error:

Building repository 'Plain RPM files cache' cache ......................................................[done]
Error building the cache:
|] Failed to cache repo (1).
Warning: Skipping repository 'Plain RPM files cache' because of the above error.
Some of the repositories have not been refreshed because of an error.

Any ideas what I need to do in order to fix this error? If this forum isn’t the appropriate place to ask this question please direct me to the correct place as this was the most applicable forum I could find in the openSUSE fourms.

Thanks for your time,
Brenton

I ran:


rpm --rebuilddb

and this error seems to have gone. Was that the solution?

Nope it hasn’t fixed it. Running:


sudo zypper in -y https://dl.google.com/linux/direct/google-earth-stable_current_x86_64.rpm

returns the output:


Error building the cache:
|] Failed to cache repo (1).                                                                                  
Building repository 'Plain RPM files cache' cache ......................................................[done]
Error building the cache:
|] Failed to cache repo (1).                                                                                  
Warning: Skipping repository 'Plain RPM files cache' because of the above error.
Retrieving repository 'Main Repository (Sources)' metadata .............................................[done]
Building repository 'Main Repository (Sources)' cache ..................................................[done]
Some of the repositories have not been refreshed because of an error.
Loading repository data...
Reading installed packages...
'_tmpRPMcache_:google-earth-stable=0:6.0.3.2197-0' not found in package names. Trying capabilities.
No provider of '_tmpRPMcache_:google-earth-stable=0:6.0.3.2197-0' found.
​

Never mind I solved this problem by running:


sudo rm -rf /var/cache/zypp /var/cache/zypper
sudo zypper up -y

Thanks! Worked for me as well!