How To switch repos from http to https

The why of this, as in why do this, is something a user in Germany reported on OpenMandriva IRC:

Turns out there is some proxy in the network that causes issues with http connections.
And all repo urls are given as http

So if this is an issue for you then this “How To” should help. Otherwise I go with “If it ain’t broke don’t fix it”.

  1. The easy one command way:

    sudo sed -i -e "s|http:|https:|g" /etc/yum.repos.d/openmandriva-rock-x86_64.repo

    For other OMLx flavors edit that line accordingly. For Rolling change rock to rolling for znver1 change x86_64 to znver1. Thanks to @mandian for this one command way.

  2. Manually edit the file way — Open Dolphin and navigate to /etc/yum.repos.d. Open the repo file for your flavor of OMLx with Kate. Highlight one instance of http then under Edit select “Replace”. At the bottom of Kate window you should see:

    Find: http

    In the line that says “Replace” enter https and select “Replace all”. Under “File” select “Save”, you will be asked for “Root privilages” password. Enter that and select OK. Done. Now test.

  3. Or edit the file from terminal way — For a Rock x86_64 system you could open the file with Kate from Konsole like this:

    $ kate /etc/yum.repos.d/openmandriva-rock-x86_64.repo

    For other OMLx flavors edit that line accordingly. For Rolling change rock to rolling for znver1 change x86_64 to znver1.

    Screen shots:

Screenshot_20220318_092000

Then test.

2 Likes