Cannot install elfutils-libelf-devel-static

Hi everyone!

I need to install elfutils-libelf-devel-static because it provides a file I need for compiling a bpf program. The file is libelf.a. I see that this file is provided by elfutils-libelf-devel-static but running the following command:

[VM] sudo dnf install elfutils-libelf-devel-static
Last metadata expiration check: 0:30:35 ago on Thu 11 Feb 2021 02:20:34 PM UTC.
No match for argument: elfutils-libelf-devel-static
Error: Unable to find a match: elfutils-libelf-devel-static

I’ve also tried:

[VM] sudo dnf install https://download-ib01.fedoraproject.org/pub/fedora/linux/releases/32/Everything/x86_64/os/Packages/e/elfutils-libelf-devel-static-0.179-1.fc32.x86_64.rpm                         1 ↵
Last metadata expiration check: 0:31:13 ago on Thu 11 Feb 2021 02:20:34 PM UTC.
elfutils-libelf-devel-static-0.179-1.fc32.x86_64.rpm                                                                                                                         81 kB/s |  80 kB     00:00
Error:
 Problem: conflicting requests
  - nothing provides elfutils-libelf-devel(x86-64) = 0.179-1.fc32 needed by elfutils-libelf-devel-static-0.179-1.fc32.x86_64
(try to add '--skip-broken' to skip uninstallable packages)

I do have elfutils-libelf-devel-0.182-1.fc33.x86_6 installed.

[VM] uname -r                                                                                                                                                                                         127 ↵
5.8.15-301.fc33.x86_64
1 Like

Sorry, but this package is not available in :Fedora: 33 anymore is was present in :fedora: 32 for installing it.

References

https://koji.fedoraproject.org/koji/buildinfo?buildID=1636949

  • Wed Jul 22 2020 - 0.180-5
  • Remove elfutils-libelf-devel-static and elfutils-devel-static subpackages.

NOTE

but I think you need both:

sudo dnf install https://kojipkgs.fedoraproject.org//packages/elfutils/0.182/1.fc32/x86_64/elfutils-devel-static-0.182-1.fc32.x86_64.rpm

and then:

sudo dnf install https://kojipkgs.fedoraproject.org//packages/elfutils/0.182/1.fc32/x86_64/elfutils-libelf-devel-static-0.182-1.fc32.x86_64.rpm

Regards.,

4 Likes

Look at elfutils-libelf-devel-0.183-1.fc34.x86_64.rpm | RPM Info | koji

There is says

Obsoletes
elfutils-libelf-devel-static < 0.180-5
libelf-devel <= 0.8.2-2

So what you want to do is install elfutils-libelf-devel, it provides the files listed here, see if the .gz contain what you are looking for…

2 Likes

According to the spec file for Fedora 33, elfutils-libelf-devel does not provide libelf.a. Looks like static libraries are removed with this commit altogether:

https://src.fedoraproject.org/rpms/elfutils/c/ec548c1605c3f672001b4eae3f52a1c20bcdbbbb?branch=f33

3 Likes

Thanks for the reply! I upgraded my system to rawhide and pulled in that package but no libelf.a file was provided. So strange that it was removed, i’m going to have to build with an ubuntu container now.

Thanks for the reply! Unfortunately trying to downgrade all the dependencies of the package broke the build in a different way :confused:

1 Like

libelf.a would be an intermediate file created during compile.

Why does it have to be a static file?
/usr/lib64/libelf.so is provided by elfutils-libelf-devel

You are also running the very base level of kernel in F33

You could add elfutils-libelf-devel(x86-64) = 0.179-1.fc32 to that last dnf install command where you tried to install the static library, and do both at the same time.

Need the static file for statically compiling a Go program with CGO enabled.

I ended up not being able to install libelf.a from any package (tried rawhide, and backtracking to f32), and instead just build elfutils/libelf from source which worked just fine.