zoukankan      html  css  js  c++  java
  • 为openSUSE添加源

    问题

    openSUSE默认的源,在安装或是更新的时候,有时候会非常慢,卡在下面这个步骤

    Retrieving repository 'Main Update Repository' metadata -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------[/]

    解决方案

    更换成国内的源

    国内源的地址

    源的话,可以到网上去找,一般都是几所大学和一些公司提供的,这里用的是网易的源,因为Debian当时用的网易的,就没有再换

    源地址 http://mirrors.163.com/

    可以在这里面找到各种开源软件系统对应的源,我们需要的是openSUSE的。

    查看当前的源信息

    $ 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.

    添加完成后,更新一下,就可以使用了

  • 相关阅读:
    测试平台系列(38) 接入github第三方登录(上)
    测试平台系列(37) 运用装饰器给用例加上执行日志
    测试平台系列(36) 使用全局变量
    测试平台系列(35) 编写全局变量管理页面
    OCP 063中文考试题库(cuug内部资料)第16题
    OCP 063中文考试题库(cuug内部资料)第15题
    D. Strange Housing 题解(思维+染色)
    B. Strange Definition 题解(质因子分解+思维)
    F. Euclid's nightmare 题解(MST+思维)
    D. Fragmentation merging 题解(思维)
  • 原文地址:https://www.cnblogs.com/studywithallofyou/p/13036504.html
Copyright © 2011-2022 走看看