DEV Community

loading...

Install missing build dependencies easily

octowaddle profile image octowaddle ・1 min read

Who doesn't know the pain: You want to build a project from source and you are constantly getting errors because you are missing some required (pkg-config) dependencies. Your next step is probably to research the dependency and find out which package contains it, which is quite time-consuming and very annoying. But there is a way to make this process easier.

If you are using an RPM-based distribution (like Fedora) you can install a missing dependency like so:

$ sudo dnf install 'pkgconfig(missing_dependency)'
Enter fullscreen mode Exit fullscreen mode

For DEB-based distributions (like Ubuntu) you can use:

$ sudo apt install $(apt-file search --package-only missing_dependency)
Enter fullscreen mode Exit fullscreen mode

(Replace missing_dependency with the pkg-config name)

Unfortunately, you still have to research the dependency manually on other distributions.

Discussion (0)

pic
Editor guide