在 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 存储库,所以我遵循的过程是:
为确保这适用于您的版本,请找到您系统的版本号,并将其替换为上述 URL 中的
42.3
. (您可以通过在浏览器中打开它们来确保 URL 有效。)您可以在以下命令的输出中看到版本号:对于 Leap 15.0 删除(来自分发链接的 suse/):