Library already installed but `dnf info` doesn't shows it and how to find its path for `PKG_CONFIG_PATH`

In the following I am trying to build hoyon/mpv-mpris: MPRIS plugin for mpv using make install, but it is not able to locate libavformat. So, I tried to install it with dnf but it seems there is already a version of it installed.

  1. But why does the dnf info doesn’t show it as installed (please see below) ?
  2. And how to find the path so that I can add it to PKG_CONFIG_PATH?

Note: I had installed ffmpeg from rpmfusion and I didn’t install libavformat manually.

$ make install
Package libavformat was not found in the pkg-config search path.
Perhaps you should add the directory containing `libavformat.pc'
to the PKG_CONFIG_PATH environment variable
Package 'libavformat', required by 'virtual:world', not found
Package 'mpv', required by 'virtual:world', not found
Package libavformat was not found in the pkg-config search path.
Perhaps you should add the directory containing `libavformat.pc'
to the PKG_CONFIG_PATH environment variable
Package 'libavformat', required by 'virtual:world', not found
cc mpris.c -o mpris.so -std=c99 -Wall -Wextra -O2 -pedantic      -shared -fPIC
mpris.c:1:10: fatal error: gio/gio.h: No such file or directory
    1 | #include <gio/gio.h>
      |          ^~~~~~~~~~~
compilation terminated.
make: *** [Makefile:28: mpris.so] Error 1
$ sudo dnf install -y libavformat-free-devel
Error: 
 Problem: package libavformat-free-devel-6.0-11.fc39.i686 from fedora requires libavformat-free(x86-32) = 6.0-11.fc39, but none of the providers can be installed
  - conflicting requests
  - libavformat-free-6.0-11.fc39.i686 from fedora  does not belong to a distupgrade repository
  - package libavformat-free-devel-6.0-11.fc39.x86_64 from fedora requires libavformat-free(x86-64) = 6.0-11.fc39, but none of the providers can be installed
  - problem with installed package ffmpeg-libs-6.0.1-3.fc39.x86_64
  - package ffmpeg-libs-6.0.1-3.fc39.x86_64 from @System conflicts with libavformat-free provided by libavformat-free-6.0-11.fc39.x86_64 from fedora
  - package ffmpeg-libs-6.0-16.fc39.x86_64 from rpmfusion-free conflicts with libavformat-free provided by libavformat-free-6.0-11.fc39.x86_64 from fedora
  - package ffmpeg-libs-6.0.1-3.fc39.x86_64 from rpmfusion-free-updates conflicts with libavformat-free provided by libavformat-free-6.0-11.fc39.x86_64 from fedora
  - package libavformat-free-devel-6.0.1-2.fc39.i686 from updates requires libavformat-free(x86-32) = 6.0.1-2.fc39, but none of the providers can be installed
  - libavformat-free-6.0.1-2.fc39.i686 from updates  does not belong to a distupgrade repository
  - package libavformat-free-devel-6.0.1-2.fc39.x86_64 from updates requires libavformat-free(x86-64) = 6.0.1-2.fc39, but none of the providers can be installed
  - package ffmpeg-libs-6.0.1-3.fc39.x86_64 from @System conflicts with libavformat-free provided by libavformat-free-6.0.1-2.fc39.x86_64 from updates
  - package ffmpeg-libs-6.0-16.fc39.x86_64 from rpmfusion-free conflicts with libavformat-free provided by libavformat-free-6.0.1-2.fc39.x86_64 from updates
  - package ffmpeg-libs-6.0.1-3.fc39.x86_64 from rpmfusion-free-updates conflicts with libavformat-free provided by libavformat-free-6.0.1-2.fc39.x86_64 from updates
(try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages)
$ sudo dnf install -y libavformat-free
Error: 
 Problem: problem with installed package ffmpeg-libs-6.0.1-3.fc39.x86_64
  - package ffmpeg-libs-6.0.1-3.fc39.x86_64 from @System conflicts with libavformat-free provided by libavformat-free-6.0-11.fc39.i686 from fedora
  - package ffmpeg-libs-6.0-16.fc39.x86_64 from rpmfusion-free conflicts with libavformat-free provided by libavformat-free-6.0-11.fc39.i686 from fedora
  - package ffmpeg-libs-6.0.1-3.fc39.x86_64 from rpmfusion-free-updates conflicts with libavformat-free provided by libavformat-free-6.0-11.fc39.i686 from fedora
  - conflicting requests
  - package ffmpeg-libs-6.0.1-3.fc39.x86_64 from @System conflicts with libavformat-free provided by libavformat-free-6.0.1-2.fc39.i686 from updates
  - package ffmpeg-libs-6.0-16.fc39.x86_64 from rpmfusion-free conflicts with libavformat-free provided by libavformat-free-6.0.1-2.fc39.i686 from updates
  - package ffmpeg-libs-6.0.1-3.fc39.x86_64 from rpmfusion-free-updates conflicts with libavformat-free provided by libavformat-free-6.0.1-2.fc39.i686 from updates
  - package ffmpeg-libs-6.0.1-3.fc39.x86_64 from @System conflicts with libavformat-free provided by libavformat-free-6.0-11.fc39.x86_64 from fedora
  - package ffmpeg-libs-6.0-16.fc39.x86_64 from rpmfusion-free conflicts with libavformat-free provided by libavformat-free-6.0-11.fc39.x86_64 from fedora
  - package ffmpeg-libs-6.0.1-3.fc39.x86_64 from rpmfusion-free-updates conflicts with libavformat-free provided by libavformat-free-6.0-11.fc39.x86_64 from fedora
  - package ffmpeg-libs-6.0.1-3.fc39.x86_64 from @System conflicts with libavformat-free provided by libavformat-free-6.0.1-2.fc39.x86_64 from updates
  - package ffmpeg-libs-6.0-16.fc39.x86_64 from rpmfusion-free conflicts with libavformat-free provided by libavformat-free-6.0.1-2.fc39.x86_64 from updates
  - package ffmpeg-libs-6.0.1-3.fc39.x86_64 from rpmfusion-free-updates conflicts with libavformat-free provided by libavformat-free-6.0.1-2.fc39.x86_64 from updates
(try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages)
$ sudo dnf info -y libavformat-free
Last metadata expiration check: 0:03:20 ago on Mon 12 Feb 2024 22:43:41 CET.
Available Packages
Name         : libavformat-free
Version      : 6.0.1
Release      : 2.fc39
Architecture : i686
Size         : 1.2 M
Source       : ffmpeg-6.0.1-2.fc39.src.rpm
Repository   : updates
Summary      : FFmpeg's stream format library
URL          : https://ffmpeg.org/
License      : GPL-3.0-or-later
Description  : The libavformat library provides a generic framework for multiplexing
             : and demultiplexing (muxing and demuxing) audio, video and subtitle
             : streams. It encompasses multiple muxers and demuxers for multimedia
             : container formats.
             : 
             : 
             : This build of ffmpeg is limited in the number of codecs supported.

Name         : libavformat-free
Version      : 6.0.1
Release      : 2.fc39
Architecture : x86_64
Size         : 1.1 M
Source       : ffmpeg-6.0.1-2.fc39.src.rpm
Repository   : updates
Summary      : FFmpeg's stream format library
URL          : https://ffmpeg.org/
License      : GPL-3.0-or-later
Description  : The libavformat library provides a generic framework for multiplexing
             : and demultiplexing (muxing and demuxing) audio, video and subtitle
             : streams. It encompasses multiple muxers and demuxers for multimedia
             : container formats.
             : 
             : 
             : This build of ffmpeg is limited in the number of codecs supported.
  • Also why does make install couldn’t find mpv?
$ echo $PATH
/home/lamy/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

$ type mpv
mpv is /usr/bin/mpv
mpv is /bin/mpv
$ sudo dnf install mpv
Package mpv-0.36.0-3.fc39.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!

On Fedora Linux, you’ll often need to install the <whatever>-devel version of the package if you want the headers and such so you can compile a package that depends on the the <whatever> package’s binaries.

I have updated the original post please see the output:

If they conflict like that, you might have to remove ffmpeg to install libavformat-free. Alternatively, maybe ffmpeg-devel has the headers/libraries you need?

Edit: It looks like ffmpeg-devel does come with some libavformat libraries.

$ rpm -ql ffmpeg-devel | grep libavformat
/usr/include/ffmpeg/libavformat
/usr/include/ffmpeg/libavformat/avformat.h
/usr/include/ffmpeg/libavformat/avio.h
/usr/include/ffmpeg/libavformat/version.h
/usr/include/ffmpeg/libavformat/version_major.h
/usr/lib64/libavformat.so
/usr/lib64/pkgconfig/libavformat.pc
/usr/share/doc/ffmpeg/libavformat.html
1 Like

Theoretically you should be able to install mpv-mpris and things should be fully covered without the need to build your own version of mpv-mpris. Mpv-mpris comes from rpmfusion-free and the only dependencies it shows for me are mpv and libXpresent (both from fedora).