为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.
添加完成后,更新一下,就可以使用了
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· 葡萄城 AI 搜索升级:DeepSeek 加持,客户体验更智能
· 什么是nginx的强缓存和协商缓存
· 一文读懂知识蒸馏