加入收藏 | 设为首页 | 会员中心 | 我要投稿 青岛站长网 (https://www.0532zz.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 服务器 > 搭建环境 > Windows > 正文

12条实用的zypper命令范例

发布时间:2018-12-18 05:40:34 所属栏目:Windows 来源:Kerneltalks
导读:zypper 是 Suse Linux 系统的包和补丁管理器,你可以根据下面的 12 条附带输出示例的实用范例来学习 zypper 命令的使用。 Suse Linux 使用 zypper 进行包管理,其是一个由 ZYpp 包管理引擎提供的包管理系统。在此篇文章中我们将分享 12 条附带输出示例的实

使用 zypper 命令附带 lrrepos 子命令列出仓库。

  1. root@kerneltalks # zypper lr
  2. Refreshing service 'cloud_update'.
  3. Repository priorities are without effect. All enabled repositories share the same priority.
  4. # | Alias | Name | Enabled | GPG Check | Refresh
  5. ---|--------------------------------------------------------------------------------------|-------------------------------------------------------|---------|-----------|--------
  6. 1 | SMT-http_smt-ec2_susecloud_net:SLE-Module-Adv-Systems-Management12-Debuginfo-Pool | SLE-Module-Adv-Systems-Management12-Debuginfo-Pool | No | ---- | ----
  7. 2 | SMT-http_smt-ec2_susecloud_net:SLE-Module-Adv-Systems-Management12-Debuginfo-Updates | SLE-Module-Adv-Systems-Management12-Debuginfo-Updates | No | ---- | ----
  8. 3 | SMT-http_smt-ec2_susecloud_net:SLE-Module-Adv-Systems-Management12-Pool | SLE-Module-Adv-Systems-Management12-Pool | Yes | (r ) Yes | No
  9. 4 | SMT-http_smt-ec2_susecloud_net:SLE-Module-Adv-Systems-Management12-Updates | SLE-Module-Adv-Systems-Management12-Updates | Yes | (r ) Yes | Yes
  10. 5 | SMT-http_smt-ec2_susecloud_net:SLE-Module-Containers12-Debuginfo-Pool | SLE-Module-Containers12-Debuginfo-Pool | No | ---- | ----
  11. 6 | SMT-http_smt-ec2_susecloud_net:SLE-Module-Containers12-Debuginfo-Updates | SLE-Module-Containers12-Debuginfo-Updates | No | ---- | ----

此处你需要检查 enabled 列来确定哪些仓库是已被启用的而哪些没有。

在 Suse Linux 中使用 zypper 添加或移除仓库

要添加仓库你需要仓库或 .repo 文件的 URI,否则你会遇到如下错误。

  1. root@kerneltalks # zypper addrepo -c SLES12-SP3-Updates
  2. If only one argument is used, it must be a URI pointing to a .repo file.

使用 URI,你可以像如下方式添加仓库:

  1. root@kerneltalks # zypper addrepo -c http://smt-ec2.susecloud.net/repo/SUSE/Products/SLE-SDK/12-SP3/x86_64/product?credentials=SMT-http_smt-ec2_susecloud_net SLE-SDK12-SP3-Pool
  2. Adding repository 'SLE-SDK12-SP3-Pool' ...........................................................................................................................[done]
  3. Repository 'SLE-SDK12-SP3-Pool' successfully added
  4. URI : http://smt-ec2.susecloud.net/repo/SUSE/Products/SLE-SDK/12-SP3/x86_64/product?credentials=SMT-http_smt-ec2_susecloud_net
  5. Enabled : Yes
  6. GPG Check : Yes
  7. Autorefresh : No
  8. Priority : 99 (default priority)
  9. Repository priorities are without effect. All enabled repositories share the same priority.

在 Suse 中使用附带 addrepoar 子命令的 zypper 命令添加仓库,后接 URI 以及你需要提供一个别名。

要在 Suse 中移除一个仓库,使用附带 removereporr 子命令的 zypper 命令。

  1. root@kerneltalks # zypper removerepo nVidia-Driver-SLE12-SP3
  2. Removing repository 'nVidia-Driver-SLE12-SP3' ....................................................................................................................[done]
  3. Repository 'nVidia-Driver-SLE12-SP3' has been removed.

清除 zypper 本地缓存

(编辑:青岛站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!