SUSE Linux – Zypper 命令示例
來源:http://www.linuxidc.com/Linux/2014-11/109214.htm
Zypper是SUSE Linux中用于安装,升级,卸载,管理仓库、进行各种包查询的命令行接口。本篇将会讨论zypper的几个不同命令的例子。

语法:
- # zypper [--global-opts] <command> [--command-opts] [command-arguments]
中括号中的部分可以不需要。执行zypper最简单的方法是输入 zypper 及 。
例子1:列出可用的全局选项和命令
打开终端,输入zypper并按回车,它会显示所有可用的全局选项和命令。
- linux-xa3t:~# zypper
例子2:获得zypper的某个命令的帮助
语法: zypper help [command]
- linux-xa3t:~# zypper help remove
- remove (rm)[options]<capability>...
- Remove packages with specified capabilities.
- A capability is NAME[.ARCH][OP<VERSION>],where OP is one of <,<=,=,>=,>.
- Command options:
- -r,--repo <alias|#|URI>Load only the specified repository.
- -t,--type <type>Type of package(package, patch, pattern, product).
- Default:package.
- -n,--name Select packages by plain name,notby capability.
- -C,--capability Select packages by capability.
- --debug-solver Create solver test casefor debugging.
- -R,--no-force-resolution Donot force the solver to find solution,let it ask.
- --force-resolution Force the solver to find a solution (even an aggressive one).
- -u,--clean-deps Automatically remove unneeded dependencies.
- -U,--no-clean-deps No automatic removal of unneeded dependencies.
- -D,--dry-run Test the removal,donot actually remove.
例子3:打开zypper shell/会话
- linux-xa3t:~# zypper sh
- zypper>
或
- linux-xa3t:~# zypper shell
- zypper>
例子4:列出已定义的仓库
- linux-xa3t:~# zypper repos

或
- linux-xa3t:~# zypper lr
4.1) 以表格的形式列出仓库的URI

4.2) 以优先级列出仓库
- linux-xa3t:~# zypper lr -p

例子5:刷新仓库
- linux-xa3t:~# zypper ref
- Repository'openSUSE-13.1-Non-Oss'is up to date.
- Repository'openSUSE-13.1-Oss'is up to date.
- Repository'openSUSE-13.1-Update'is up to date.
- Repository'openSUSE-13.1-Update-Non-Oss'is up to date.
- All repositories have been refreshed.
例子6:修改zypper仓库
zypper仓库可以通过别名、数字或者URI或者通过‘–all、 –remote、 –local、 –medium-type’这些选项修改。
linux-xa3t:~ # zypper mr -d 6 #禁用6号仓库 linux-xa3t:~ # zypper mr -rk -p 70 upd #启用自动书信并为‘upd’仓库设置rpm文件‘缓存’,且设置它的优先级为70 linux-xa3t:~ # zypper mr -Ka #为所有的仓库禁用rpm文件缓存 linux-xa3t:~ # zypper mr -kt #为远程仓库设置rpm文件缓存
例子7:添加仓库
语法: zypper addrepo 或者 zypper ar <仓库的URL或者别名>
- linux-xa3t:~# zypper ar http://download.opensuse.org/update/13.1/ update
- Adding repository 'update'.............................................[done]
- Repository'update' successfully added
- Enabled:Yes
- Autorefresh:No
- GPG check:Yes
- URI: http://download.opensuse.org/update/13.1/
例子8:移除仓库
语法: zypper removerepo <仓库名> <别名>
或者
zypper rr <仓库名> <别名>
- linux-xa3t:~# zypper rr openSUSE-13.1-1.10 openSUSE-13.1-1.10
- Removing repository 'openSUSE-13.1-1.10'............................[done]
- Repository'openSUSE-13.1-1.10' has been removed.
更多详情见请继续阅读下一页的精彩内容: http://www.linuxidc.com/Linux/2014-11/109214p2.htm
SUSE Linux – Zypper 命令示例的更多相关文章
- 爹地,我找到了!15个极好的Linux find命令示例
爹地,我找到了!15个极好的Linux find命令示例 http://blog.jobbole.com/48931/ 妈咪,我找到了!15个实用的Linux find命令示例 http://blog ...
- 爹地,我找到了!,15个极好的Linux find命令示例
爹地,我找到了!, 15个极好的Linux find命令示例 英文原文:Daddy, I found it!, 15 Awesome Linux Find Command Examples 标签: L ...
- 妈咪,我找到了! -- 15个实用的Linux find命令示例
妈咪,我找到了! -- 15个实用的Linux find命令示例 英文原文:Mommy, I found it! — 15 Practical Linux Find Command Examples ...
- 15个极好的Linux find命令示例(二)
前阵子,我们审查了15件实事 find命令的例子(第一部分).查找命令可以做很多比只是在寻找基于名称的文件 (第2部分)在这篇文章中,让我们来讨论15高级find命令的例子, 包括-根据它访问,修改或 ...
- 15个实用的Linux find命令示例(一)
除了在一个目录结构下查找文件这种基本的操作,你还可以用find命令实现一些实用的操作,使你的命令行之旅更加简易. 本文将介绍15种无论是于新手还是老鸟都非常有用的Linux find命令. 首先,在你 ...
- 15个实用的Linux find命令示例
妈咪,我找到了! -- 15个实用的Linux find命令示例 http://www.oschina.net/translate/15-practical-linux-find-command-ex ...
- <转>13个实用的Linux find命令示例
注:本文摘自青崖白鹿,翻译的妈咪,我找到了! -- 15个实用的Linux find命令示例, 感谢翻译的好文. 除了在一个目录结构下查找文件这种基本的操作,你还可以用find命令实现一些实用的操作, ...
- 10种有用的Linux Bash_Completion 命令示例
摘要:我们可以对这个 bash 补全进行加速,并使用 complete 命令将其提升到一个新的水平. 本文分享自华为云社区<有用的 Linux Bash_Completion 命令示例(Ster ...
- 30个实用的Linux find命令示例
除了在一个目录结构下查找文件这种基本的操作,你还可以用find命令实现一些实用的操作,使你的命令行之旅更加简易. 本文将介绍15种无论是于新手还是老鸟都非常有用的Linux find命令. 首先,在你 ...
随机推荐
- VMware下centos桥接模式静态ip配置
声明:本文转载自http://blog.csdn.net/ltr15036900300/article/details/48828207,非原创. 一.配置虚拟机centos网络 备份网络文件 [ro ...
- 源码安装svn 1.8.9
2014年5月25日 12:26:14 需要文件: svn apr apr-util sqlite3 serf svn : http://subversion.apache.org/download/ ...
- laravel 5.1 Model 属性详解
<?php namespace Illuminate\Database\Eloquent; /** * 下面提到某些词的含义: * 1.覆盖: 在继承该类 \Illuminate\Databas ...
- selenium 操作文本框(textarea输入)
selenium 对文本框的输入操作一般有两种形式,传统的是直接通过定位元素通过sendKeys()方法直接在文本框中输入信息.但有时候我们可以通过id 的方式将其进行定位,但却不能通过sendKey ...
- django 实现文件下载功能
一.概述 在实际的项目中很多时候需要用到下载功能,如导excel.pdf或者文件下载,当然你可以使用web服务自己搭建可以用于下载的资源服务器,如nginx,这里我们主要介绍django中的文件下载. ...
- 发送统计邮件shell脚本
#!/bin/bash#作者:Presley#时间:2018.07.16#监控阿里云aaa库的py_weixin_product_close_rating_info 和 py_weixin_produ ...
- ubuntu ifconfig只有lo没有ens33的问题
如果ifconfig只显示了lo, ifconfig -a 却正常显示ens33.那么可以按照如下的操作: service network-manager stop rm /var/lib/Netwo ...
- 配置免SSH
在要远程登录别人的服务器中生成授权标识:ssh-keygen -t rsa上传至需被免登录的服务器:scp ~/.ssh/id_rsa.pub root@xx.xx.xx.xx:/root/.ssh/ ...
- 各jQuery选择器的用法(转)
这篇文章来介绍下jQuery的选择器. 选择器是jQuery的根基,在jQuery中,对事件处理.遍历DOM和Ajax操作都依 赖于选择器.因此,如果能熟练的使用选择器,不仅能简化代码,而且可以达到事 ...
- MySql 时间戳存char还是存int?
一次小事故,让我对时间戳存char还是存int有了深刻的印象. 生产环境的sql条件涉及到时间戳字段的大小比较(between and),当时设计的时间戳类型是char(10),结果当数据量达到200 ...