Tutorial: How to find a missing component on Clear Linux

Suppose you are compiling something from source code but it complains that you don’t have a dependency, here are a few things you can do.

  1. You can do a swupd search to check whether that thing is bundled.
  2. It’s possible that you’ve already installed the dependency, but CL does not install its pkgconfig files by default. You just need to install the devpkg-* bundle.
  3. If you know the file name of something you are missing, you can try swupd search-file.
  4. swupd search-file is slow sometimes because it needs to download all package manifest. You can also go to https://github.com/clearlinux-pkgs and search there instead. You can filter the result by only shown RPM Spec file format. Suppose a package foo contains that component, you can then swupd search foo to see which bundle contains that package.
  5. In some cases, you will see something show up in the SPEC file of a package, but even after you installed that, the specific file your require may still don’t show up in your system. This is because sometimes a package is divided into multiple components, such as foo-doc and foo-dev, but CL only bundled a subset of those components. One way to deal with this is to go to https://cdn.download.clearlinux.org/releases/current/clear/x86_64/os/Packages/ and install the particular RPM. You can find information on how to install RPM on the forum.
6 Likes

Thank you very much for this. It will be really useful and it will avoid a lot of repeated questions here.

Is it already in the documentation fo CL? If not, Is it possible to add it?

@doct0rHu
Thanks for sharing :wink:

I’m tired of repeating questions so I wrote this.
To add this to the official documentation though, requires this to be expanded and more clearly explained. But that’s pretty much against my initial (de)motivation…

1 Like

Many times I happened to miss libraries when trying to compile something, and often the only alternative to manually compiling the missing dependency was to download a multi-GB bundle. It would be cool sometimes to have the flexibility to install just a package

Just find the package, and install its RPM (compiled on CL)