rpm-software-management / dnf5

Next-generation RPM package management system
Other
259 stars 88 forks source link

Allow filtering metalinks by location/domain #1483

Open bc-lee opened 6 months ago

bc-lee commented 6 months ago

As I understand, Fedora's dnf uses metalinks by default. It downloads the metalink file and then selects the fastest mirror from the list. This is great for most users, but it would be beneficial to have the option to filter mirrors by location/domain. For example, this would allow users to exclude mirrors known to be out of sync or slow.

From a configuration standpoint, adding options in the main section of /etc/dnf/dnf.conf would be ideal, as users want to control all repositories at once. An example configuration is shown below:

[main]
gpgcheck=True
...
metalink_exclude_domain=^mirror1\.example\.com$
# XX is an artificial country code for testing
metalink_exclude_location=^XX$

To achieve this functionality, librepo would need to be updated to allow filtering by location/domain as well.

ppisar commented 6 months ago

As far as I know Fedora monitors mirrors and excludes bad ones from metalink document. However, I can see that this feature can be beneficial if there is a network problem between the host and the mirror. Or when the metalink generator does not monitor mirrors properly.