rpm-software-management / dnf5

Next-generation RPM package management system
Other
240 stars 82 forks source link

DNF5 is not able to resolve package files to the package name. #1771

Closed Ferlinuxdebian closed 22 hours ago

Ferlinuxdebian commented 1 week ago

DNF4 has an option in the repoquery subcommand that can convert the output of file dependencies to packages using the --resolve parameter. For example:

fernando@fedora:~$ dnf4 repoquery --requires gimp
Last metadata expiration check: 0:00:32 ago on qui 10 out 2024 20:12:50.
/usr/bin/python3
gimp-libs(x86-64) = 2:2.99.19^20240927git771dd219f6-1.fc41
gimp-libs(x86-64) = 2:2.99.19^20241007git22f383914d-1.fc41
gjs
hicolor-icon-theme
libIex-3_2.so.31()(64bit)
libOpenEXR-3_2.so.31()(64bit)
libX11.so.6()(64bit)
libXcursor.so.1()(64bit)
libXext.so.6()(64bit)

In the output above, you can see that the dependencies for GIMP appear as a list of file names, which is not very useful. However, by using the --resolve parameter, this list of files is converted into package names:

fernando@fedora:~$ dnf4 repoquery --requires gimp --resolv
Last metadata expiration check: 0:02:24 ago on qui 10 out 2024 20:12:50.
aalib-libs-0:1.4.0-0.51.rc5.fc41.x86_64
alsa-lib-0:1.2.12-2.fc41.x86_64
babl-0:0.1.108^20240927git6ecbee3-1.fc41.x86_64
bzip2-libs-0:1.0.8-19.fc41.x86_64
cairo-0:1.18.0-4.fc41.x86_64
cfitsio-0:4.5.0-4.fc41.x86_64
fontconfig-0:2.15.0-8.fc41.x86_64
freetype-0:2.13.3-1.fc41.x86_64

The point I want to make is that DNF5 does not implement this feature. For example, when installing telegram-desktop on Fedora 41, I see an error output with a list of files instead of package names, which is not useful.

fernando@localhost-live:~$ sudo dnf install telegram-desktop 
[sudo] senha para fernando: 
Updating and loading repositories:
Repositories loaded.
Falha ao resolver a transação:
Problema: package telegram-desktop-5.2.3-1.fc41.x86_64 from rpmfusion-free requires libavformat.so.60()(64bit), but none of the providers can be installed
  - package telegram-desktop-5.2.3-1.fc41.x86_64 from rpmfusion-free requires libavformat.so.60(LIBAVFORMAT_60)(64bit), but none of the providers can be installed
  - package telegram-desktop-5.2.3-1.fc41.x86_64 from rpmfusion-free requires libavutil.so.58()(64bit), but none of the providers can be installed
  - package telegram-desktop-5.2.3-1.fc41.x86_64 from rpmfusion-free requires libavutil.so.58(LIBAVUTIL_58)(64bit), but none of the providers can be installed
  - package telegram-desktop-5.2.3-1.fc41.x86_64 from rpmfusion-free requires libswscale.so.7()(64bit), but none of the providers can be installed
  - package telegram-desktop-5.2.3-1.fc41.x86_64 from rpmfusion-free requires libswscale.so.7(LIBSWSCALE_7)(64bit), but none of the providers can be installed
  - package telegram-desktop-5.2.3-1.fc41.x86_64 from rpmfusion-free requires libswresample.so.4()(64bit), but none of the providers can be installed
  - package telegram-desktop-5.2.3-1.fc41.x86_64 from rpmfusion-free requires libswresample.so.4(LIBSWRESAMPLE_4)(64bit), but none of the providers can be installed
  - package telegram-desktop-5.2.3-1.fc41.x86_64 from rpmfusion-free requires libavfilter.so.9()(64bit), but none of the providers can be installed
  - package telegram-desktop-5.2.3-1.fc41.x86_64 from rpmfusion-free requires libavfilter.so.9(LIBAVFILTER_9)(64bit), but none of the providers can be installed
  - solicitações conflitantes
  - nothing provides libtesseract.so.5.4.1()(64bit) needed by ffmpeg-libs-6.1.2-2.fc41.x86_64 from rpmfusion-free
You can try to add to command line:
  --skip-broken to skip uninstallable packages
kontura commented 6 days ago

DNF5 does implement the feature but it was renamed. Instead of dnf4 repoquery --requires gimp --resolv you can do dnf5 repoquery --providers-of=requires gimp

You can find these changes described in the changes doc: https://dnf5.readthedocs.io/en/latest/changes_from_dnf4.7.html#changes-to-individual-commands in the repoquery section.