Unable to install local RPM files

Hey guys,

I’ve been using zypper to install downloaded RPM files locally on my machine. This has worked for as along as I can remember, but earlier the installation command started failing with a cryptic error message that I can’t make sense of. This error happens for any RPM file I have downloaded. Here is the output when I try to install an RPM - any thoughts?

$ zypper in *.rpm
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).
Disabling repository 'Plain RPM files cache' because of the above error.

Thanks!

Try running the command as root (your use of the ‘$’ prompt implies a
non-root user, so you should prepend the command with ‘sudo’).

If that does not work, how about disk space; do you have enough under /var
to cache everything?


Good luck.

If you find this post helpful and are logged into the web interface,
show your appreciation and click on the star below…

Hi,

In addition to what ab said, the proper way is to either use an array plus glob or create a plaindir directory repo for your rpm(s).

Using bash glob and array.

packages=(*.rpm)

or use an absolute path

packages=(/path/to/foo/*.rpm)

then install it.

zypper in "${packages@]}"

Create a local directory as a repository where your rpm’s are located

zypper ar -t plaindir . local

or use an absolute path

zypper ar -t /path/to/foo local

Refresh the local repo named local

zypper ref local

Now search for the packages in that directory using zypper or install it directly since you know the names of the packages.
Or print the packages on the local repo.

zypper --no-refresh se -t package -r local

I hope that helps.

Another possibility is that your repo cache is corrupted.

Simple solution is to purge the repo cache and let it re-build

zypper clean --all && zypper ref

After the above command, try installing your local rpm again using the same command you’ve always used.

TSU