use https mirror only in zypper

zypper gets best mirror from its metadata, that’s a good thing but, my bandwidth is bad. so, it doesn’t really matter. but, I wanna use https mirror only. all of the time zypper uses http mirrors. how can I ask zypper to use https?

Hi
I would find a https in your locale to has a good sync priority disable you current download.opensuse.org repos and then duplicate the url’s using your mirror…

For example;


zypper lr -dE
....
 2 |download.opensuse.org-oss        | Main Repository (OSS)  | Yes     | (r ) Yes  | Yes     |   99     | rpm-md   | http://download.opensuse.org/tumbleweed/repo/oss/
....

zypper mr -d -F -p 101 2

Repository 'download.opensuse.org-oss' has been successfully disabled.
Autorefresh has been disabled for repository 'download.opensuse.org-oss'.
Repository 'download.opensuse.org-oss' priority has been set to 101.

Visit http://download.opensuse.org/tumbleweed/repo/oss/ and click a download link say down in repo data;

For example;
http://download.opensuse.org/tumbleweed/repo/oss/repodata/0d0a8d873d64f17fc98dbde1f7615bc56ab184232866a1fe2232eba791190984-susedata.it.xml.gz.mirrorlist

I’m in the US So I see a https mirror at https://provo-mirror.opensuse.org/tumbleweed/repo/oss/repodata/0d0a8d873d64f17fc98dbde1f7615bc56ab184232866a1fe2232eba791190984-susedata.it.xml.gz

I can re-add the mirror repo via;


zypper ar -f -g -n "Main Repository (OSS)" https://provo-mirror.opensuse.org/tumbleweed/repo/oss/ download.opensuse.org-oss-https

Adding repository 'Main Repository (OSS)' ..............................................................................................................................[done]
Repository 'Main Repository (OSS)' successfully added

URI         : https://provo-mirror.opensuse.org/tumbleweed/repo/oss/
Enabled     : Yes
GPG Check   : Yes
Autorefresh : Yes
Priority    : 99 (default priority)

Repository priorities are without effect. All enabled repositories share the same priority.

zypper -vvv ref -f

Then force a refresh and check your output with;


zypper lr -dE

can I add/use more than one mirror for same repository?

Hi
I would find a https in your locale to has a good sync priority disable you current download.opensuse.org repos and then duplicate the url’s using your mirror…

For example…

can I add/use more than one mirror for same repository?

Hi
Probably not, better to use the download-only option and then when that’s done zypper dup.

First, list the URLs of individual repos with zypper lr -u. Check the URI column in the output and find those repos with the basic http:// protocol specified.

Second, go to**/etc/zypp/repos.d,** and open individual *.repo files in a text editor corresponding to those repos that you want to change from HTTP to HTTPS.

Third, change http:// -> https:// in the baseurl= line.

Last, check the repo is available via HTTPS by running sudo zypper ref <repo>. It will refresh the metadata. If the repo is not accessible via HTTPS, the command will be stuck. All default repos are available in the HTTPS variant however. Personally, I have 14 out of 15 repos which are enabled set to use HTTPS.