The correct approach to enforcing the usage of a different RPMFusion mirror

Hello.

Some time ago, I wrote a post about the blacklisted RPMFusion mirror:

I received information under that post that it is possible to change the mirror URL without affecting the installed packages. However, I don’t know how to do it correctly. I found a post on a similar topic, but it was so old that it referred to the YUM configuration and not DNF. I would not want a change I made manually, to cause conflicts in the future or interfere with the automatically generated DNF/systemd configuration.

So how do I correctly force RPMFusion to use a mirror other than the one I am being served, or explicitly specify a different one?

Best regards,
Krzysztof

sudo nano /etc/yum.repos.d/[repository].repo

There will be a baseurl and there will be a metalink url in those *.repo files. Metalink pulls from a random mirror. You can comment it out with # and uncomment the baseurl link by deleting the # and download straight from RPM Fusion.

You can even create your own baseurl link to mirrors you specify. For instance I’m in the UK and use Mirrorservice for all my downloads most of the time. If I wanted to create a baseurl that only downloaded from Mirrorservice I would add the line baseurl https://www.mirrorservice.org/sites/download1.rpmfusion.org/free/fedora/releases/$releasever/Everything/$basearch/os/ to rpmfusion-free.repo as well as the Mirrorservice links to the debug and source repos in that *.repo file.

You’d have to make the changes to each of the *.repo files located in /etc/yum.repos.d/ you wanted to use a specific url. Once you make the changes you simply sudo dnf updateinfo list && sudo dnf upgrade. It’ll pull packages directly from RPM Fusion, or an alternative mirror you’ve setup.

There might be an easier way to do it through dnf but I don’t know it, so wait and see if anyone else comes along with some command line magic.

First, you need to know which mirror you want to use and backup your existing rpmfusion repo files in /etc/yum.repos.d/. Then, run the following command, replacing <your mirror> with the URL of the mirror.

sudo sed -e 's|^metalink=|#metalink=|g' \
         -e 's|^#baseurl=http://download1.rpmfusion.org|baseurl=https:<your mirror>|g' \
         -i.bak \
         /etc/yum.repos.d/rpmfusion*.repo