Opensuse

為什麼我會收到“警告:儲存庫 ‘oss_update’ 似乎已過時。請考慮使用不同的鏡像或伺服器。”?

  • August 18, 2020

在 WSL 上,我執行sudo zypper update了 ,但收到此錯誤消息。

正在載入儲存庫數據…

**警告:**儲存庫“oss_update”似乎已過時。考慮使用不同的鏡像或伺服器。

正在讀取已安裝的軟體包…

沒事做。

但是,當我執行時sudo zypper refresh,我沒有收到任何錯誤消息。

Retrieving repository 'The Go Programming Language (openSUSE_Leap_42.3)' metadata ...............................................................................................................................................[done]
Retrieving repository 'devel:languages:php (openSUSE_Leap_42.3)' metadata .......................................................................................................................................................[done]
Repository 'oss' is up to date.
Retrieving repository 'oss_update' metadata .....................................................................................................................................................................................[done]
Retrieving repository 'PHP7 extensions (php7_openSUSE_Leap_42.3)' metadata ......................................................................................................................................................[done]
All repositories have been refreshed

我檢查了我正在使用的儲存庫列表zypper lr -u

# | Alias                      | Name                                             | Enabled | GPG Check | Refresh | URI
--+----------------------------+--------------------------------------------------+---------+-----------+---------+-------------------------------------------------------------------------------------------------
1 | devel_languages_go         | The Go Programming Language (openSUSE_Leap_42.3) | Yes     | (r ) Yes  | No      | http://download.opensuse.org/repositories/devel:/languages:/go/openSUSE_Leap_42.3/
2 | devel_languages_php        | devel:languages:php (openSUSE_Leap_42.3)         | Yes     | (r ) Yes  | No      | http://download.opensuse.org/repositories/devel:/languages:/php/openSUSE_Leap_42.3/
3 | oss                        | oss                                              | Yes     | (r ) Yes  | No      | http://download.opensuse.org/distribution/leap/42.3/repo/oss/suse/
4 | oss_update                 | oss_update                                       | Yes     | (r ) Yes  | No      | http://download.opensuse.org/update/leap/42.3/oss/
5 | server_php_extensions_php7 | PHP7 extensions (php7_openSUSE_Leap_42.3)        | Yes     | (r ) Yes  | No      | http://download.opensuse.org/repositories/server:/php:/extensions:/php7/php7_openSUSE_Leap_42.3/

當我檢查http://download.opensuse.org/update/leap/42.3/oss/的內容時,我看到文件和目錄已於 2018 年 3 月 23 日更新,因此它們似乎沒有過時。

為什麼我會收到關於儲存庫已過時的錯誤消息?如何更改我正在使用的儲存庫?我應該使用什麼?

我從https://www.reddit.com/r/bashonubuntuonwindows/comments/8fcbs5/update_of_opensuse_on_wsl_error/找到了答案:您需要將儲存庫 URI 從 HTTP 更改為 HTTPS。我只是這樣做了,並且能夠看到新的包裹。我只有 oss 和 oss_update 儲存庫,所以我遵循的過程是:

sudo zypper rr oss
sudo zypper rr oss_update
sudo zypper ar https://download.opensuse.org/distribution/leap/42.3/repo/oss/suse/ oss
sudo zypper ar https://download.opensuse.org/update/leap/42.3/oss/ oss_update

sudo zypper ref
sudo zypper up

為確保這適用於您的版本,請找到您系統的版本號,並將其替換為上述 URL 中的42.3. (您可以通過在瀏覽器中打開它們來確保 URL 有效。)您可以在以下命令的輸出中看到版本號:

cat /etc/os-release

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