Install copr packages on Silverblue

I am trying to install a package named keyd to remap my keyboard from the copr repo alternateved/keyd Copr on Fedora Silverblue 40.

The way I did this is first donwload the repo file by

wget https://copr.fedorainfracloud.org/coprs/alternateved/keyd/repo/fedora-40/alternateved-keyd-fedora-40.repo

And copy the downloaded repo file into /etc/yum.repos.d, then run

rpm-ostree refresh-md

But when I try to install the package

rpm-ostree install keyd

It reports error:

❯ rpm-ostree install keyd
Inactive requests:
  langpacks-en (already provided by langpacks-en-4.0-13.fc40.noarch)
Checking out tree 1caf22c... done
Enabled rpm-md repositories: rpmfusion-nonfree-steam copr:copr.fedorainfracloud.org:alternateved:keyd copr:copr.fedorainfracloud.org:phracek:PyCharm fedora-cisco-openh264 rpmfusion-nonfree-nvidia-driver google-chrome fedora updates updates-archive
Importing rpm-md... done
rpm-md repo 'rpmfusion-nonfree-steam' (cached); generated: 2024-07-05T08:54:24Z solvables: 2
rpm-md repo 'copr:copr.fedorainfracloud.org:alternateved:keyd' (cached); generated: 2024-07-28T17:07:16Z solvables: 5
rpm-md repo 'copr:copr.fedorainfracloud.org:phracek:PyCharm' (cached); generated: 2024-03-18T11:54:41Z solvables: 14
rpm-md repo 'fedora-cisco-openh264' (cached); generated: 2024-03-12T11:45:42Z solvables: 3
rpm-md repo 'rpmfusion-nonfree-nvidia-driver' (cached); generated: 2024-07-25T21:08:16Z solvables: 29
rpm-md repo 'google-chrome' (cached); generated: 2024-07-26T17:32:09Z solvables: 3
rpm-md repo 'fedora' (cached); generated: 2024-04-14T18:51:11Z solvables: 74881
rpm-md repo 'updates' (cached); generated: 2024-07-28T01:56:06Z solvables: 22686
rpm-md repo 'updates-archive' (cached); generated: 2024-06-30T05:31:17Z solvables: 22869
Resolving dependencies... done
Checking out packages... done
error: Checkout keyd-2.5.0-1.fc40.x86_64: opendir(local): No such file or directory

More background: When I first installed Fedora Silverblue 39 on my computer last November, I was able to install the package using the same steps as listed above. Today(07/28/2024), this package got updated, and it seems everything is broken.

1 Like

I’m not sure, but I bet that it has something to do with /usr/local
/usr/local is not actually a directory but a symlink to /var/usrlocal (you know, on Silverblue /usr is immutable).
If you compare the 2.4.3 spec file and the 2.5.0 one you will see that in the latest version it tries to install stuff in /usr/local, and ostree can’t handle that… I am just speculating, maybe we need a ostree expert.

In the meanwhile you could contact the copr maintainer and ask if it is really necessary to use /usr/local

2 Likes

Added f40 and removed f39, nvidia, workstation

Added atomic-desktops, copr, rpm-ostree

good point!

Can such a script use a check function and install to /var/usrlocal/ instead? This would work, especially needed if these files are mutable, like the config files it seems to place there.

I think this may be the problem. If I download the source code of this package, and build it with:

make PREFIX=/var/usrlocal
make install

Will this bypass the restriction?

I actually think this is a pretty good idea, not just if the maintainer of this particular package will want to do that though. It seems the maintainer is just building this package for regular Fedora.

Maybe. But at this point you are not using the RPM anymore.

Care to elaborate? The RPM places things there. This does not work. A fix should best support all Fedora variants.

I was replying to @snake

1 Like

Hi, I’m aware of this issue. With latest version of keyd the default prefix has changed to /usr/local ([Maintainer Note] PREFIX changed to /usr/local · Issue #628 · rvaiya/keyd · GitHub) and maintainers were notified about this in advance. I’m actually using the Atomic variant and I’m currently troubleshooting this issue. Most likely I’ll go back to /usr prefix.

1 Like

It should be fixed with version 2.5.0-3. Apologies for any issues this recent update might have caused. In the future please let me know if something isn’t working properly (I’ve stumbled upon this discussion purely on accident).

3 Likes

Thanks for your reply. Since you are also using an atomic variant, what would be the best way to install a package from COPR on an atomic Fedora variant?

I think your approach @snake is what we currently have. I have no knowledge about any other way that would allow COPR management. I might be wrong as I don’t track Atomic development that closely.

That said, I’ve created a simple wrapper script that I use for that purpose, you can find it in my dotfiles here. It allows me to enable/disable COPRs with simple command copr enable alternateved/keyd or copr disable alternateved/keyd.

I think we have at least 3 of those wrapper scripts now XD

the dnf copr command is pretty easy to implement, but official integration would require adding it to rpm-ostree.

I also have a wrapper script with support for almost all common tasks.

But this issue was not about the addition of the .repo file but the actual RPM. I also had an RPM fail poorly, the kernel-longterm package by kwizart that I would love to use

Haha, that looks much more elaborate than what I have. Nice work! :smiley:

I guess we all had to find some ways of managing current state of Atomic development.

I mean it just takes one person to add that stuff to rpm-ostree haha but I am too overloaded to learn real programming

Do you know a way to make keyd works with flatpak ? i set it , but only works in my terminal

Please refer to quickstart section in keyd documentation. That should be enough to have keyd working in flatpak, graphical environment and TTY.

I wish to install lilay/topgrade Copr

# dnf copr enable lilay/topgrade
bash: dnf: command not found

How-To proceed in Fedora Sliverblue 42? What is the official way?