Rocky Linux and “Nothing provides …” error

When installing packages on Rocky Linux, sometimes it is needed to enable the EPEL repository.

And sometimes something goes wrong while downloading the dependancies getting an error like the following:

# dnf install corosync
Last metadata expiration check: 0:00:20 ago on Fri 18 Nov 2022 02:07:30 PM CET.
Error:
 Problem: conflicting requests
  - nothing provides libknet.so.1()(64bit) needed by corosync-3.1.5-0.4.el9.2.x86_64
  - nothing provides libknet.so.1(LIBKNET)(64bit) needed by corosync-3.1.5-0.4.el9.2.x86_64
  - nothing provides libknet1 >= 1.18 needed by corosync-3.1.5-0.4.el9.2.x86_64
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

In order to get all dependencies met, you need to enable the Powertools or CRB repository (source)

Here, how you enable it in Rocky Linux 8:

# dnf config-manager --set-enabled powertools

And here, how you enable it in Rocky Linux 9:

# dnf config-manager --set-enabled crb