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

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

我想改變

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

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

在 yast -> 軟體儲存庫 -> 編輯 -> 編輯儲存庫的部分 -> “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:~ # 

答案1

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

您可以通過測試

$ zypper ref

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

相關內容