执行“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'.分别执行下面四条命令去将阿里的软件源添加到本机。命令如下:
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:~ #阿里巴巴开源镜像站 —— https://developer.aliyun.com/mirror/
USTC Mirror —— http://mirrors.ustc.edu.cn/help/index.html
网易开源镜像站 —— http://mirrors.163.com/
搜狐镜像站 —— http://mirrors.sohu.com/
清华大学开源软件镜像站 —— https://mirrors.tuna.tsinghua.edu.cn/help/bananian/