2

On Fedora I have enabled a third-party repository for a non-free software (SoftMaker). When I run dnf commands as root (such as sudo dnf search -C vim), everything works fine. However, when I run the same command as non-root, I get the following error:

> dnf search -C vim
SoftMaker Office Repository                                16 kB/s | 991  B     00:00
Importing GPG key 0xAA3E7F5E:
 Userid     : "SoftMaker repository (GPG key for signing files) <[email protected]>"
 Fingerprint: CC7D 2EDF 4808 EFFA 0E00 FC72 3413 DA98 AA3E 7F5E
 From       : http://shop.softmaker.com/repo/linux-repo-public.key
Is this ok [y/N]: y
Error: Cache-only enabled but no cache for 'SoftMaker_Office_Repository'

The gpg key import question aris every time, even though I answered y before. I imported the key via sudo rpmkeys --import linux-repo-public.key, but it did not help.

So: Is there anything I can do to create the cache for the user (or is it a problem from the repository provider)?

The corresponding repo file /etc/yum.repos.d/softmaker.repo looks like this:

[SoftMaker_Office_Repository]
name=SoftMaker Office Repository
enabled=1
baseurl=http://shop.softmaker.com/repo/rpm
path=/
type=rpm-md
keeppackages=0
gpgcheck=1
repo_gpgcheck=1
gpgkey=http://shop.softmaker.com/repo/linux-repo-public.key
enabled_metadata=0

(The unfortunate side effect is, that Gnome-Software does not work at all due to this...)

9
  • No idea what the issue is but dnf is meant to be used under root/sudo, so I'm curious why you're trying to solve an issue you've yourself created. Aug 19, 2020 at 11:29
  • 1
    @ArtemS.Tashkinov no, dnf supports many operations run as regular users (especially search which isn’t supposed to change anything); and it integrates with PolicyKit so even for operations requiring root privileges, starting it as a regular user is fine. Aug 19, 2020 at 11:38
  • @StephenKitt dnf search under a regular user cannot use/update the system-wide cache which makes using it kinda counter-productive as it needs to download all the repos to /var/tmp/dnf-$user-$random. Besides the OP is specifically talking about installing a package the very task which is meant to be run under root/sudo. Aug 19, 2020 at 11:44
  • 1
    Gnome-Software and other GUI software managers for Fedora don't use dnf directly per se, they use its APIs. :-) Aug 19, 2020 at 11:53
  • 1
    you mean on the host's/repository side? Yes, exactly Aug 19, 2020 at 15:42

1 Answer 1

-1

The message

Cache-only enabled but no cache for

comes from libdnf:Repo.cpp:

if (syncStrategy == SyncStrategy::ONLY_CACHE)

So it just quits, if it had gone on it will do the fetch.

Question is how did ONLY_CACHE occur, as not using -C or --cacheonly, or where the frig it might be getting it from?

2

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .