Answer

问题及解答

openSUSE 中软件源的管理

Posted by haifeng on 2026-08-31 10:15:36 last update 2026-08-31 10:21:15 | Edit | Answers (1)

列出软件源

haifeng@localhost:~> zypper lr
软件源优先级无效。所有已启用的软件源将使用相同的优先级。

#  | Alias                       | Name                                             | Enabled | GPG Check | Refresh
---+-----------------------------+--------------------------------------------------+---------+-----------+--------
 1 | home_Dead_Mozay             | home:Dead_Mozay (15.6)                           | 是      | (r ) 是   | 否
 2 | openSUSE-Leap-15.6-1        | openSUSE-Leap-15.6-1                             | 否      | ----      | ----
 3 | repo-backports-debug-update | Update repository with updates for openSUSE Le-> | 否      | ----      | ----
 4 | repo-backports-update       | Update repository of openSUSE Backports          | 是      | (r ) 是   | 是
 5 | repo-debug                  | Debug Repository                                 | 否      | ----      | ----
 6 | repo-debug-non-oss          | Debug Repository (Non-OSS)                       | 否      | ----      | ----
 7 | repo-debug-update           | Update Repository (Debug)                        | 否      | ----      | ----
 8 | repo-debug-update-non-oss   | Update Repository (Debug, Non-OSS)               | 否      | ----      | ----
 9 | repo-non-oss                | Non-OSS Repository                               | 是      | (r ) 是   | 是
10 | repo-openh264               | Open H.264 Codec (openSUSE Leap)                 | 是      | (r ) 是   | 是
11 | repo-oss                    | Main Repository                                  | 是      | (r ) 是   | 是
12 | repo-sle-debug-update       | Update repository with debuginfo for updates f-> | 否      | ----      | ----
13 | repo-sle-update             | Update repository with updates from SUSE Linux-> | 是      | (r ) 是   | 是
14 | repo-source                 | Source Repository                                | 否      | ----      | ----
15 | repo-update                 | Main Update Repository                           | 是      | (r ) 是   | 是
16 | repo-update-non-oss         | Update Repository (Non-Oss)                      | 是      | (r ) 是   | 是

 

禁用或删除不需要的软件源

如果 home_Dead_Mozay 这个第三方软件源不再需要, 可以使用 zypper rr home_Dead_Mozay  删除. 或者使用 zypper mr home_Dead_Mozay 禁用, 然后确认不再需要时再删除.

sudo zypper rr home_Dead_Mozay

 

刷新软件源

haifeng@localhost:~> sudo zypper refresh  
软件源 'Update repository of openSUSE Backports' 是最新的。           
软件源 'Update repository with updates from SUSE Linux Enterprise 15' 是最新的。 
软件源 'Main Update Repository' 是最新的。
软件源 'Update Repository (Non-Oss)' 是最新的。                        
软件源 'Non-OSS Repository' 是最新的。                                
软件源 'Open H.264 Codec (openSUSE Leap)' 是最新的。                  
软件源 'Main Repository' 是最新的。                                                                                    
全部软件源均已刷新


 

1

Posted by haifeng on 2026-08-31 10:58:41

例. 安装 emacs 时碰到 repo-openh264 这个源不稳定.

sudo zypper install emacs emacs-info
 

中途显示错误

正在检索: libopenh264-8-2.6.0-2.sle150600.1.x86_64.rpm .....................................................................................[错误 (369 B/s)]
下载 (curl) 'http://codecs.opensuse.org/openh264/openSUSE_Leap/x86_64/libopenh264-8-2.6.0-2.sle150600.1.x86_64.rpm' 出错:
错误代码:Curl error 56
错误消息:Recv failure: 连接被对方重设


 

检查源

haifeng@localhost:~> zypper lr -d | grep -i h264
9 | repo-openh264               | Open H.264 Codec (openSUSE Leap)                                                            | 是      | (r ) 是   | 是    
 | -    |   99     | rpm-md | http://codecs.opensuse.org/openh264/openSUSE_Leap/                      |


 

删除此源
haifeng@localhost:~> sudo zypper rr repo-openh264
正在移除软件源 'Open H.264 Codec (openSUSE Leap)' .....................................................................................................[完毕]
已移除软件源 'Open H.264 Codec (openSUSE Leap)'。'


 

添加清华的源

sudo zypper addrepo https://mirrors.tuna.tsinghua.edu.cn/opensuse/distribution/leap/$releasever/repo/oss/ repo-openh264

 

重新刷新源并安装

sudo zypper ref
sudo zypper install emacs emacs-info

 

参考

https://mirrors.tuna.tsinghua.edu.cn/help/opensuse/