修改 openSUSE 15.2 软件源为阿里云

本文将介绍怎样修改 openSUSE 15.2 发行版本的软件源为阿里云。

禁用本地默认的软件源

执行“sudo zypper mr -da”命令将本地所有的软件源禁用,可以使用“sudo zypper lr”命令查看详情。实例:

localhost:~ # zypper mr -da
Nothing to change for repository 'NON-OSS'.
Repository 'NON-OSS-UPDATE-USTC' has been successfully disabled.
Repository 'NON-OSS-USTC' has been successfully disabled.
Nothing to change for repository 'OSS'.
Repository 'OSS-UPDATE-USTC' has been successfully disabled.
Repository 'OSS-USTC' has been successfully disabled.
Nothing to change for repository 'PACKMAN'.
Nothing to change for repository 'UPDATE-NON-OSS'.
Nothing to change for repository 'UPDATE-OSS'.
Nothing to change for repository 'USTC-NON-OSS'.
Nothing to change for repository 'USTC-OSS'.
Repository 'openSUSE-13.1-Non-Oss' has been successfully disabled.
Repository 'openSUSE-13.1-Oss' has been successfully disabled.
Repository 'openSUSE-13.1-Update-Non-Oss' has been successfully disabled.
Repository 'openSUSE-13.1-Update-Oss' has been successfully disabled.
Nothing to change for repository 'openSUSE-Leap-15.2-1'.
Nothing to change for repository 'repo-debug'.
Nothing to change for repository 'repo-debug-non-oss'.
Nothing to change for repository 'repo-debug-update'.
Nothing to change for repository 'repo-debug-update-non-oss'.
Nothing to change for repository 'repo-non-oss'.
Nothing to change for repository 'repo-oss'.
Nothing to change for repository 'repo-source'.
Nothing to change for repository 'repo-source-non-oss'.
Nothing to change for repository 'repo-update'.
Nothing to change for repository 'repo-update-non-oss'.

添加 Aliyun mirrors 阿里软件源

分别执行下面四条命令去将阿里的软件源添加到本机。命令如下:

sudo zypper ar -fc https://mirrors.aliyun.com/opensuse/distribution/leap/15.2/repo/oss openSUSE15.2-Aliyun-OSS
sudo zypper ar -fc https://mirrors.aliyun.com/opensuse/distribution/leap/15.2/repo/non-oss openSUSE15.2-Aliyun-NON-OSS
sudo zypper ar -fc https://mirrors.aliyun.com/opensuse/update/leap/15.2/oss openSUSE15.2-Aliyun-UPDATE-OSS
sudo zypper ar -fc https://mirrors.aliyun.com/opensuse/update/leap/15.2/non-oss openSUSE15.2-Aliyun-UPDATE-NON-OSS

实例:

localhost:~ # zypper addrepo -f http://mirrors.aliyun.com/opensuse/distribution/leap/15.2/repo/oss/ openSUSE-15.2-Oss
com/opensuse/update/leap/15.2/oss/ openSUSE-15.2-Update-Oss
Adding repository 'openSUSE-15.2-Oss' ..................................................................[done]
Repository 'openSUSE-15.2-Oss' successfully added
URI         : http://mirrors.aliyun.com/opensuse/distribution/leap/15.2/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.

localhost:~ # zypper addrepo -f http://mirrors.aliyun.com/opensuse/distribution/leap/15.2/repo/non-oss/ openSUSE-15.2-Non-Oss
Adding repository 'openSUSE-15.2-Non-Oss' ..............................................................[done]
Repository 'openSUSE-15.2-Non-Oss' successfully added
URI         : http://mirrors.aliyun.com/opensuse/distribution/leap/15.2/repo/non-oss/
Enabled     : Yes
GPG Check   : Yes
Autorefresh : Yes
Priority    : 99 (default priority)
Repository priorities are without effect. All enabled repositories share the same priority.

localhost:~ # zypper addrepo -f http://mirrors.aliyun.com/opensuse/update/leap/15.2/oss/ openSUSE-15.2-Update-Oss
Adding repository 'openSUSE-15.2-Update-Oss' ...........................................................[done]
Repository 'openSUSE-15.2-Update-Oss' successfully added
URI         : http://mirrors.aliyun.com/opensuse/update/leap/15.2/oss/
Enabled     : Yes
GPG Check   : Yes
Autorefresh : Yes
Priority    : 99 (default priority)
Repository priorities are without effect. All enabled repositories share the same priority.

localhost:~ # zypper addrepo -f http://mirrors.aliyun.com/opensuse/update/leap/15.2/non-oss/ openSUSE-15.2-Update-Non-Oss
Adding repository 'openSUSE-15.2-Update-Non-Oss' .......................................................[done]
Repository 'openSUSE-15.2-Update-Non-Oss' successfully added
URI         : http://mirrors.aliyun.com/opensuse/update/leap/15.2/non-oss/
Enabled     : Yes
GPG Check   : Yes
Autorefresh : Yes
Priority    : 99 (default priority)
Repository priorities are without effect. All enabled repositories share the same priority.

刷新软件源

执行 “sudo zypper ref”命令去刷新软件源。实例:

localhost:~ # zypper ref
Retrieving repository 'openSUSE-15.2-Non-Oss' metadata .............................................................................................................[done]
Building repository 'openSUSE-15.2-Non-Oss' cache ..................................................................................................................[done]
Retrieving repository 'openSUSE-15.2-Oss' metadata .................................................................................................................[done]
Building repository 'openSUSE-15.2-Oss' cache ......................................................................................................................[done]
Retrieving repository 'openSUSE-15.2-Update-Non-Oss' metadata ......................................................................................................[done]
Building repository 'openSUSE-15.2-Update-Non-Oss' cache ...........................................................................................................[done]
Retrieving repository 'openSUSE-15.2-Update-Oss' metadata ..........................................................................................................[done]
Building repository 'openSUSE-15.2-Update-Oss' cache ...............................................................................................................[done]
All repositories have been refreshed.
localhost:~ #

国内镜像推荐

我们一定要给自己提出这样的任务:第一,学习,第二是学习,第三还是学习。 —— 列宁
0 不喜欢
说说我的看法 -
全部评论(
没有评论
关于
本网站专注于 Java、数据库(MySQL、Oracle)、Linux、软件架构及大数据等多领域技术知识分享。涵盖丰富的原创与精选技术文章,助力技术传播与交流。无论是技术新手渴望入门,还是资深开发者寻求进阶,这里都能为您提供深度见解与实用经验,让复杂编码变得轻松易懂,携手共赴技术提升新高度。如有侵权,请来信告知:hxstrive@outlook.com
其他应用
公众号