Hi, Is there a way to control what local mirrors Fedora is using? It looks like Fedora picks some random ones that are not optimal or appropriate. Some are far outside of my country. I’d like limit them to my country or the closest neighbor of my choice. To be clear: I’d like to specify a country, not fastestmirror=True.
I found some discussions on this topic but they’re couple of years old and contain dead links.
Ar you on F41 already? On F40 you could still use dfn4 and then the syntax could be different.
Please complete the tags with such kind of info’s. This helps us to help you
In the past, with dnf, you could append country=xx to the end of the metalink line in any .repo file. This was supposed to make dnf then use the repos in the country of your choosing. For me, something like this as an example:
I need to wait for an update now, but, at least, it doesn’t seem to have broken anything.
Edit.: I think it works. dnf repoinfo shows now Base URLs pointing to a local university in my country and if I change it to one the neighboring countries, it points to organizations in those countries.
Just to complete the path/file names for novices or casual fedora users:
#for brazil it just makes sense on the fedora/fedora-updates and maybe testing repo. Rest is not available.
/etc/yum.repos.d
.
├── fedora.repo
├── fedora-updates.repo
etc.
# copr repos are from chile by default.
as already mentioned fastest mirror is relative while in dnf5 are other criteria s by default, searching for best performance.
Keep in mind that fastestmirror chooses a mirror with the lowest latency, which is not necessarily the fastest. It’s usually better to leave it disabled as there is already a server side mechanism (mirrormanager), which takes bandwidth and other heuristiscs into account, to provide the best mirror for a user.
I don’t have fastestmirror set as far as I can tell. I would try it but yeah, it’s true that low latency does not mean better throughput.
It was trying to pull updates from countries 2000 km away from me, and failing, while there are nice and fast local mirrors within 200-300 km from my city.
Besides the obvious performance issues there are some countries I’d rather not download updates and software from.
This means, you can just with a vpn guide dnf, which country you want effectively allow to download, while using the addition of &country=xx. This would also mean that you have to use a payed vpn while using the countries close to yours.
The free Proton VPN as an example just gives you four countries for free. And from them the majority is also blocked by pi-hole because they are used for any kind of access.
As also mentioned above in my example about Brazil. If the repository is not available on the Mirror you like to use close to you, dnf will search a mirror which has the data and then the closest/fastest to your place.
Every software has, and for that there a fixes. If you use Opensource-Software more eyes have access to the code and more fixes are proposed and generally they are fixed faster.
I don’t want to use VPN. I want to keep it as simple as possible and without third party tools. It looks like adding country=xx solves the issue for me. Thanks