Opensuse

如何將 OpenSuse 儲存庫 URL 更改為 HTTPS?

  • April 30, 2017

我想改變

http://download.opensuse.org/tumbleweed/repo/oss/

https://download.opensuse.org/tumbleweed/repo/oss/

在 yast -> software repositories -> edit -> edit parts of repo -> “x” https(在它是純 http 之前),但它只是給了我錯誤消息:

Download (curl) error for 'https://download.opensuse.org/update/tumbleweed/repo/repoindex.xml': 
Error code: Bad URL
Error message: Protocol "http" not supported or disabled in libcurl

但如果我手動嘗試,http 和 https 都會失敗:

linux-4tur:~ # curl https://download.opensuse.org/update/tumbleweed/repo/repoindex.xml
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved <a href="http://download.opensuse.org/repositories/openSUSE:/Factory:/Update/standard/repo/repoindex.xml">here</a>.</p>
<hr>
<address>Apache/2.2.12 (Linux/SUSE) Server at download.opensuse.org Port 443</address>
</body></html>
linux-4tur:~ # curl http://download.opensuse.org/update/tumbleweed/repo/repoindex.xml
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved <a href="http://download.opensuse.org/repositories/openSUSE:/Factory:/Update/standard/repo/repoindex.xml">here</a>.</p>
<hr>
<address>Apache/2.2.12 (Linux/SUSE) Server at download.opensuse.org Port 80</address>
</body></html>
linux-4tur:~ # 

*.repo您可以使用文本編輯器編輯下面的文本文件,而不是使用 yast /etc/zypp/repos.d/

你可以通過測試

$ zypper ref

順便說一句curl -L ...,用於跟踪重定向。

引用自:https://unix.stackexchange.com/questions/362259