suse换阿里云源

查看当前的源信息

$ sudo zypper repos -d
*  | Alias                     | Name                               | Enabled | GPG Check | Refresh | Priority | Type   | URI                                                                                | Service**
---+---------------------------+------------------------------------+---------+-----------+---------+----------+--------+------------------------------------------------------------------------------------+--------
 1 | openSUSE-Leap-15.1-1      | openSUSE-Leap-15.1-1               | No      | ----      | ----    |   99     | rpm-md | hd:/?device=/dev/disk/by-id/usb-ADATA_USB_Flash_Drive_000000000000000143-0:0-part1 |        
 2 | repo-debug                | Debug Repository                   | No      | ----      | ----    |   99     | NONE   | http://download.opensuse.org/debug/distribution/leap/15.1/repo/oss/                |        
 3 | repo-debug-non-oss        | Debug Repository (Non-OSS)         | No      | ----      | ----    |   99     | NONE   | http://download.opensuse.org/debug/distribution/leap/15.1/repo/non-oss/            |        
 4 | repo-debug-update         | Update Repository (Debug)          | No      | ----      | ----    |   99     | NONE   | http://download.opensuse.org/debug/update/leap/15.1/oss/                           |        
 5 | repo-debug-update-non-oss | Update Repository (Debug, Non-OSS) | No      | ----      | ----    |   99     | NONE   | http://download.opensuse.org/debug/update/leap/15.1/non-oss/                       |        
 6 | repo-non-oss              | Non-OSS Repository                 | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/distribution/leap/15.1/repo/non-oss/                  |        
 7 | repo-oss                  | Main Repository                    | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/distribution/leap/15.1/repo/oss/                      |        
 8 | repo-source               | Source Repository                  | No      | ----      | ----    |   99     | NONE   | http://download.opensuse.org/source/distribution/leap/15.1/repo/oss/               |        
 9 | repo-source-non-oss       | Source Repository (Non-OSS)        | No      | ----      | ----    |   99     | NONE   | http://download.opensuse.org/source/distribution/leap/15.1/repo/non-oss/           |        
10 | repo-update               | Main Update Repository             | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/update/leap/15.1/oss                                  |        
11 | repo-update-non-oss       | Update Repository (Non-Oss)        | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/update/leap/15.1/non-oss/                             |        

我们看到当前使用了4个源,openSUSE一般使用4个源,两个update,两个distribution,每个都有oss和non-oss

禁用原来的源
sudo zypper mr -da

添加网易的源
复制代码

$ sudo zypper addrepo -f http://mirrors.163.com/openSUSE/update/leap/15.1/non-oss update-repo-no-oss163
[sudo] password for root:
Adding repository 'update-repo-no-oss163' .................................................................................................................................................................[done]
Repository 'update-repo-no-oss163' successfully added

URI         : http://mirrors.163.com/openSUSE/update/leap/15.1/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 addrepo -f http://mirrors.163.com/openSUSE/update/leap/15.1/oss update-repo-oss163
Adding repository 'update-repo-oss163' ....................................................................................................................................................................[done]
Repository 'update-repo-oss163' successfully added

URI         : http://mirrors.163.com/openSUSE/update/leap/15.1/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 addrepo -f http://mirrors.163.com/openSUSE/distribution/leap/15.1/repo/oss dis-repo-oss163
Adding repository 'dis-repo-oss163' .......................................................................................................................................................................[done]
Repository 'dis-repo-oss163' successfully added

URI         : http://mirrors.163.com/openSUSE/distribution/leap/15.1/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.



$ sudo zypper addrepo -f http://mirrors.163.com/openSUSE/distribution/leap/15.1/repo/non-oss dis-repo-non-oss163
Adding repository 'dis-repo-non-oss163' ...................................................................................................................................................................[done]
Repository 'dis-repo-non-oss163' successfully added

URI         : http://mirrors.163.com/openSUSE/distribution/leap/15.1/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.

添加的时候,找到自己系统对应的版本,添加的命令,就是前面是url,后面是昵称,昵称随便定义

更新一下系统

$ sudo zypper refresh
Retrieving repository 'dis-repo-non-oss163' metadata ....................................................................................................................................................................................................................[done]
Building repository 'dis-repo-non-oss163' cache .........................................................................................................................................................................................................................[done]
Retrieving repository 'dis-repo-oss163' metadata ........................................................................................................................................................................................................................[done]
Building repository 'dis-repo-oss163' cache .............................................................................................................................................................................................................................[done]
Retrieving repository 'update-repo-no-oss163' metadata ..................................................................................................................................................................................................................[done]
Building repository 'update-repo-no-oss163' cache .......................................................................................................................................................................................................................[done]
Retrieving repository 'update-repo-oss163' metadata .....................................................................................................................................................................................................................[done]
Building repository 'update-repo-oss163' cache ..........................................................................................................................................................................................................................[done]
All repositories have been refreshed.

其他命令:
suse 添加/删除源

添加  zypper ar http://******/**.repo  aaa  (ps:aaa是别名)

删除  zypper rr  http://******

添加科大镜像源,以 openSUSE Leap 42.3 为例:

sudo zypper ar -fcg https://mirrors.ustc.edu.cn/opensuse/distribution/leap/42.3/repo/oss USTC:42.3:OSS
sudo zypper ar -fcg https://mirrors.ustc.edu.cn/opensuse/distribution/leap/42.3/repo/non-oss USTC:42.3:NON-OSS
sudo zypper ar -fcg https://mirrors.ustc.edu.cn/opensuse/update/leap/42.3/oss USTC:42.3:UPDATE-OSS
sudo zypper ar -fcg https://mirrors.ustc.edu.cn/opensuse/update/leap/42.3/non-oss USTC:42.3:UPDATE-NON-OSS

更新一下系统

$ sudo zypper refresh
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

湫一刀

希望大家多多支持

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值