存档:Zypper 11.0 的用法
| 本文正在考虑删除! 理由 openSUSE 11.0 已经 EOL -- 01:17, 25 March 2011 (MDT)。 请勿清空、合并、移动本文档或删除此通知。请参阅本文档的 页面和我们的 删除策略以获取更多信息。 |
版本:11.0 本文档介绍的是 zypper 0.11.6,它出现在 中。有关其他版本,请参阅 Zypper 版本、Zypper 用法和 Zypper 用法 11.1。
快速参考
这是您最常使用的内容。
zypper # to print the list of available global options and commands zypper help search # to print help for the search command zypper lu # to see what patch updates are needed zypper up # to apply the patch updates zypper se sqlite # to search for sqlite zypper rm sqlite2 # to remove sqlite2 zypper in sqlite3 # to install sqlite3 zypper in yast* # to install all packages matching 'yast*' zypper up -t package # to upgrade all installed packages with newer versions, where possible
常规用法
Zypper 的一般语法是
zypper [global-options] command [command-options] [arguments] ...
方括号内的组件不是必需的,因此执行 zypper 的最简单方法是键入其名称,后跟一个 。例如,要应用系统所需的补丁,请键入
zypper update
此外,您可以选择一个或多个 ,方法是在命令之前键入它们:(运行命令,但不要问我任何问题,自行决定)
zypper --non-interactive update
要使用特定命令的选项,请在命令之后键入它们:(应用所需的补丁到系统,但不要要求我确认任何许可证,我之前已经阅读过它们)
zypper update --auto-agree-with-licenses
有些命令需要一个或多个参数:(安装或更新 mplayer 软件包)
zypper install mplayer
有些选项还需要一个参数:(更新系统中的较新软件包)
zypper update -t package
以上所有内容组合:(仅使用 factory 仓库安装 mplayer 和 amarok,并显示详细信息)
zypper -v install --repo factory mplayer amarok
词汇
- 仓库 - 包含软件包和各种软件包信息(软件包元数据)的本地或远程目录。仓库以前被称为安装源、服务或目录)。
- 别名 - 仓库别名是仓库名称的简短版本,用于仓库处理命令和选项,例如removerepo或--repo.
- 软件包 - 软件软件包(RPM 软件包、源代码软件包)。补丁、模式和产品也通常被称为不同类型的软件包。
- 补丁 - 表示一个软件包或一组软件包,用于安装更新(主要是错误修复)。
- 模式 - 表示一组软件包。例如,Http 服务器模式将定义依赖项,以便安装该模式时将触发所有运行和管理 http 服务器所需的软件包的安装。
- product - 代表整个产品(例如“openSUSE 10.3”)。
命令
zypper 提供许多可以分为以下类别的命令
- 仓库管理
refresh, repos, addrepo, removerepo, modifyrepo, namerepo - 软件包管理
install, remove, update, dist-upgrade, source-install - 查询
search, info, what-provides, list-updates, patch-check, patches, packages, patterns, products - 锁定
locks, addlock, removelock - 实用工具
verify, install-new-recommends - other
help
此外,update, list-updates, patch-check,和patches命令可以称为 更新管理 命令。
打印帮助信息
首先,了解如何获取帮助很重要。要打印常规帮助(命令和全局选项的列表),只需键入zypper不带任何选项或参数。要打印特定命令的帮助,请使用
# zypper help [command]
zypper -h [command]和zypper [command] -h为了方便起见也是可能的。
存储库管理
您可以指定现有仓库,通过使用zypper lr生成的列表中的编号、别名或 URI。使用编号时,请务必始终检查zypper lr首先,因为您对仓库进行了一些更改后,编号可能会发生变化。
列出已定义的仓库
repos
示例输出
$ zypper lr # | Alias | Name | Enabled | Refresh --+-----------------------+-----------------------+---------+-------- 1 | packman | Packman 11.0 | Yes | No 2 | fate | fate | No | No 3 | openSUSE-11.0-Updates | Updates for 11.0 | Yes | Yes 4 | repo-oss | openSUSE-11.0-Oss | Yes | No 5 | repo-non-oss | openSUSE-11.0-Non-Oss | Yes | No 6 | repo-debug | openSUSE-11.0-Debug | No | No
其他示例
zypper lr -u # to include also repo URI in the table zypper lr -d # to include several other repo properties in the table zypper lr -P # to include also repo priority and sort the list by it zypper lr -e my # export all repository definitions into file named 'my.repo'
添加仓库
addrepo
在添加任何仓库之前,必须定义至少一个仓库。要添加仓库,请使用addrepo命令
示例输出
$ zypper ar http://download.videolan.org/pub/vlc/SuSE/11.0 vlc Adding repository 'vlc' [done] Repository 'vlc' successfully added Enabled: Yes Autorefresh: No URI: http://download.videolan.org/pub/vlc/SuSE/11.0
其他示例
zypper ar http://download.opensuse.org/repositories/X11:/XGL/openSUSE_11.0/X11:XGL.repo # via .repo file zypper ar -c ftp://some.download.site myalias # probe the repository upon adding zypper ar my/dir/with/rpms local # add your local directory with rpm files as repository
有关受支持的媒体类型和 URI 的列表,请参阅 。
刷新仓库
refresh
添加仓库后或当仓库过时时,需要刷新它。这意味着从仓库下载软件包元数据并将数据预处理为.solv缓存以进行快速读取。
$ zypper refresh Downloading repository 'Packman 11.0' metadata [done] Building repository 'Packman 11.0' cache [done] Downloading repository 'Updates for 11.0' metadata [done] Building repository 'Updates for 11.0' cache [done] Repository 'openSUSE-11.0-Oss' is up to date. All repositories have been refreshed.
如果仓库的自动刷新已启用,则无需担心刷新,它会在需要时自动发生。但是,有些人更喜欢控制何时进行刷新(例如,为了避免在只想查看“zypper info krusader”时等待刷新完成),因此他们会禁用自动刷新。请参阅man zypper了解更多详细信息。
其他示例
zypper ref packman main # you can also specify which repositories to refresh zypper ref -f upd # force refresh of the 'upd' repository
删除仓库
removerepo
$ zypper rr vlc 1 23 foo Repository 23 not found by alias, number or URI. Repository foo not found by alias, number or URI. Removing repository 'repo-debug' [done] Repository 'repo-debug' has been removed. Removing repository 'vlc' [done] Repository 'vlc' has been removed.
修改仓库
modifyrepo
禁用仓库 #6
$ zypper mr -d 6 Repository 'repo-non-oss' has been sucessfully disabled.
启用“packman”仓库的自动刷新和 rpm 文件缓存,并将其优先级设置为 70
$ zypper mr -rk -p 70 packman Autorefresh has been enabled for repository 'packman'. RPM files caching has been enabled for repository 'packman'. Repository 'packman' priority has been set to 70.
禁用所有仓库的 RPM 文件缓存
$ zypper mr -Ka Nothing to change for repository 'local'. RPM files caching has been disabled for repository 'packman'. Nothing to change for repository 'fate'. Nothing to change for repository 'upd'. Nothing to change for repository 'repo-oss'. Nothing to change for repository 'repo-non-oss'.
启用所有仓库的 RPM 文件缓存
$ zypper mr -ka RPM files caching has been enabled for repository 'repo-non-oss'. RPM files caching has been enabled for repository 'Main Repository (OSS)'. RPM files caching has been enabled for repository 'Main Repository (NON-OSS)'. RPM files caching has been enabled for repository 'openSUSE-11.0-Updates'.
重命名仓库
namerepo
$ zypper nr 3 upd Repository 'openSUSE-11.0-Updates' renamed to 'upd'.
目前该命令只能更改仓库的别名。如果您希望更改仓库的显示名称,请查看mr命令。
为了方便作为命令参数和 --repo 选项使用,请保持别名简短简单。使用别名比使用仓库编号(因为编号可能会更改并且容易出错)和使用 URI(因为 URI 很长,需要复制粘贴)更安全、更方便。
导出/导入
repos -e
您可以将完整的仓库列表导出到文件,并在以后或另一台机器上导入它。
zypper lr --export backups/repos/foo.repo zypper ar backups/repos/foo.repo
软件包管理
安装软件包
install
您可以按名称或它们提供的功能安装软件包
$ zypper install git Reading installed packages... The following NEW packages are going to be installed: subversion-perl sqlite3 perl-DBD-SQLite git-svn git-cvs git Overall download size: 1.1 M. After the operation, additional 4.6 M will be used. Continue? [YES/no]: Downloading package subversion-perl-1.5.0-96.1.x86_64 (1/6), 950.0 K (4.1 M unpacked) Downloading: subversion-perl-1.5.0-96.1.x86_64.rpm [done] Installing: subversion-perl-1.5.0-96.1 [done] Downloading package sqlite3-3.5.7-17.1.x86_64 (2/6), 30.0 K (40.0 K unpacked) Downloading: sqlite3-3.5.7-17.1.x86_64.rpm [done] Installing: sqlite3-3.5.7-17.1 [done] Downloading package perl-DBD-SQLite-1.14-41.1.x86_64 (3/6), 44.0 K (103.0 K unpacked) Downloading: perl-DBD-SQLite-1.14-41.1.x86_64.rpm [done] Installing: perl-DBD-SQLite-1.14-41.1 [done] Downloading package git-svn-1.5.4.5-26.1.x86_64 (4/6), 66.0 K (195.0 K unpacked) Downloading: git-svn-1.5.4.5-26.1.x86_64.rpm [done] Installing: git-svn-1.5.4.5-26.1 [done] Downloading package git-cvs-1.5.4.5-26.1.x86_64 (5/6), 63.0 K (205.0 K unpacked) Downloading: git-cvs-1.5.4.5-26.1.x86_64.rpm [done] Installing: git-cvs-1.5.4.5-26.1 [done] Downloading package git-1.5.4.5-26.1.x86_64 (6/6), 10.0 K (3.0 K unpacked) Downloading: git-1.5.4.5-26.1.x86_64.rpm [done] Installing: git-1.5.4.5-26.1 [done]
...或它们提供的功能
$ zypper in MozillaFirefox \< 3 Reading installed packages... 'MozillaFirefox' providing 'MozillaFirefox<3' is already installed. Nothing to do.
$ zypper in MozillaFirefox \>= 3 Reading installed packages... The following packages are going to be upgraded: mozilla-xulrunner190-translations MozillaFirefox mozilla-xulrunner190-gnomevfs mozilla-xulrunner190 MozillaFirefox-translations The following package is going to be REMOVED: mozilla-xulrunner190-lang Overall download size: 11.0 M. After the operation, 12.9 M will be freed. Continue? [Y/n/p/?]:
$ zypper in 'libqtiff.so()(64bit)' Reading installed packages... 'libqt4-x11' providing 'libqtiff.so()(64bit)' is already installed. Nothing to do.
其他示例
zypper in yast* # install all yast modules zypper in -t pattern lamp_server # install lamp_server pattern (packages needed for a LAMP server) zypper in vim -emacs # install vim and remove emacs in one go zypper in amarok packman:libxine1 # install libxine1 from packman and amarok from any repo zypper in bitchx-1.1-81.x86_64.rpm # install bitchx rpm from local directory zypper in -f subversion # force reinstallation of subversion
删除软件包
remove
该remove命令与 install 命令非常相似,只是效果相反 :O)
$ zypper remove sqlite Reading installed packages... The following packages are going to be REMOVED: sqlite3 perl-DBD-SQLite git-cvs git After the operation, 351.0 K will be freed. Continue? [YES/no]: n
源代码软件包和构建依赖项
source-install
$ zypper si zypper Reading installed packages... The following NEW packages are going to be installed: libzypp-devel libsatsolver-devel The following source package is going to be installed: zypper Overall download size: 1.5 M. After the operation, additional 6.7 M will be used. Continue? [YES/no]:
您还可以仅安装构建依赖项或仅源代码包
zypper si -D zypper # only the source packages (no build deps) zypper si -d zypper # only the build deps (no source package)
更新软件包
update -t package
dist-upgrade
以下是关于使用可用较新版本更新软件包的信息。有关另一种更新类型,请参阅 更新管理。
zypper dup # use the distribution upgrade algorithm (handles package splits, unmaintaned packages and similar) zypper up -t package # update all installed packages with newer version as far as possible zypper up -t package libzypp zypper # update libzypp and zypper zypper in libzypp sqlite3 # update sqlite3 or install it if not yet installed
查询
搜索软件包
search
默认情况下,search 命令查找任何类型、状态或仓库的软件包,这些软件包的名称包含指定的字符串(不区分大小写)
$ zypper se sqlite Reading installed packages... S | Name | Summary | Type --+--------------------------+----------------------------------------------------------------+-------- | libapr-util1-dbd-sqlite3 | DBD driver for SQLite 3 | package i | libgda-3_0-sqlite | Sqlite Provider for GNU Data Access (GDA) | package | libqt4-sql-sqlite | Qt 4 sqlite plugin | package i | libsqlite3-0 | Shared libraries for the Embeddable SQL Database Engine | package | libsqlite3-0-32bit | Shared libraries for the Embeddable SQL Database Engine | package | mediatomb-sqlite | UPnP AV MediaServer | package i | mono-data-sqlite | Database connectivity for Mono | package | pdns-backend-sqlite2 | SQLite 2 backend for pdns | package | pdns-backend-sqlite3 | SQLite 3 backend for pdns | package i | perl-DBD-SQLite | The DBD::SQLite is a self contained RDBMS in a DBI driver | package i | php5-sqlite | PHP5 Extension Module | package | python-sqlite2 | Python bindings for sqlite 2 | package | qt3-sqlite | SQLite Database Plug-In for Qt | package | rekall-sqlite | Rekall sqlite Database Backend | package | rubygem-sqlite3 | A Ruby interface for the SQLite3 database engine | package i | sqlite2 | Embeddable SQL Database Engine | package | sqlite2-32bit | Embeddable SQL Database Engine | package | sqlite2-devel | Embeddable SQL Database Engine | package i | sqlite3 | Embeddable SQL Database Engine | package | sqlite3-devel | Embeddable SQL Database Engine | package | sqlite3-tcl | Tcl binding for SQLite | package | tntdb1-sqlite | Tntdb is a c++-class-library for easy database-access - sqlite | package | ulogd-sqlite | SQLite output plugin for ulogd | package
第一列中的 i 表示该软件包已安装。要查看匹配软件包的所有可用版本,请使用--details/-s选项
$ zypper search -s --match-exact virtualbox-ose Reading installed packages... S | Name | Type | Version | Arch | Repository --+----------------+---------+------------+--------+------------------------------------ v | virtualbox-ose | package | 1.6.2-2.1 | x86_64 | VirtualBox OSE (OBS, openSUSE 11.0) i | virtualbox-ose | package | 1.5.6-33.1 | x86_64 | openSUSE-11.0-Oss v | virtualbox-ose | package | 1.5.6-20.5 | x86_64 | VirtualBox OSE (OBS, openSUSE 11.0) v | virtualbox-ose | package | 1.6.2-2.1 | i586 | VirtualBox OSE (OBS, openSUSE 11.0) v | virtualbox-ose | package | 1.5.6-33.1 | i586 | openSUSE-11.0-Oss v | virtualbox-ose | package | 1.5.6-20.3 | i586 | VirtualBox OSE (OBS, openSUSE 11.0)
i 表示此特定版本已安装,v 表示此软件包的其他版本当前已安装。
其他示例
zypper se -dC --match-words RSI # look for RSI acronym (case-sensitively), also in summaries and descriptions zypper se 'yast*' # show all packages starting with 'yast' (beware of shell expansion, quote the strings if unsure!) zypper se -r packman # list all packages from 'packman' repository zypper se -i sqlite # show all installed packages containing 'sqlite' in their name zypper se -t pattern -r repo-oss # list all patterns available in the 'repo-oss' repository zypper se -t product # list all available products
获取软件包信息
info
$ zypper info amarok Reading installed packages... Information for package amarok: Repository: Packman 11.0 Name: amarok Version: 1.4.9.1-103.pm.1 Arch: x86_64 Vendor: packman.links2linux.de Installed: Yes Status: up-to-date Installed Size: 12.1 M Summary: Media Player for KDE Description: Amarok is a media player for all kinds of media, supported by aRts, GStreamer or Xine (depending on the packages you install). This includes MP3, Ogg Vorbis, audio CDs and streams. It also supports audio effects of all kinds that are provided by aRts. Playlists can be stored in .m3u or .pls files. Amarok also provides audio file collection management, by using either an embedded sqlite3, a MySQL or a PostgreSQL database.
此命令显示有关名为“amarok”的软件包的详细信息。
其他示例
zypper info -t patch MozillaFirefox # show information about 'MozillaFirefox' patch zypper patch-info MozillaFirefox # the same as above zypper info -t pattern lamp_server # show info about 'lamp_server' pattern zypper info -t product openSUSE-FTP # show info about specified product
依赖关系
what-provides
要列出指定功能的所有提供者,请执行
$ zypper wp firefox Reading installed packages... S | Name | Type | Version | Arch | Repository --+----------------+---------+-------------+--------+------------------ i | MozillaFirefox | package | 3.0-0.1 | x86_64 | Updates for 11.0 v | MozillaFirefox | package | 2.9.95-25.1 | x86_64 | openSUSE-11.0-Oss v | MozillaFirefox | package | 3.0-0.1 | i586 | Updates for 11.0 v | MozillaFirefox | package | 2.9.95-25.1 | i586 | openSUSE-11.0-Oss
此命令类似于rpm -q --whatprovides firefox,但rpm只能查询 RPM 数据库(已安装软件包的数据库)。另一方面,Zypper 会告诉您来自任何仓库的功能提供者,而不仅仅是已安装的仓库。
其他查询
patches、packages、patterns 和 products 命令类似于 search -s -t [patch,package,pattern,product],除了它们显示特定于相应软件包类型的其他信息。例如patches还显示补丁的状态(需要/安全/不适用)。
命令 list-updates 和 patch-check 在 更新管理 中讨论。
软件包锁定
locks
addlock
removelock
软件包锁的作用是防止系统上软件包的更改。匹配活动锁的软件包无法更改其安装状态;已安装的软件包无法删除或升级,尚未安装的软件包无法安装。
要锁定所有以“yast2”开头的软件包,请执行
$ zypper al 'yast2*' Reading installed packages... Specified lock has been successfully added.
再次注意 shell 扩展,如果 yast* 可能会匹配工作目录中的某些文件或目录,请使用引号。
要列出当前活动的锁
$ zypper ll # | Name | Type | Repository --+------------------+---------+----------- 1 | libpoppler3 | package | (any) 2 | libpoppler-glib3 | package | (any) 3 | yast* | package | (any)
要删除锁,请执行
$ zypper rl yast2-packager Reading installed packages... The following query locks some of the objects you want to unlock: type: package match_type: glob case_sensitive: on solvable_name: yast2* Do you want remove this lock? [YES/no]: y Lock count has been succesfully decreased by: 1
其他示例
zypper al zypper # lock package 'zypper' (exact match) zypper al -r repo-oss virtualbox* # restrict the lock to 'repo-oss' repository (allowing installation from others) zypper rl 3 # remove lock by number
您还可以通过直接编辑 锁文件 来操作锁。
实用工具
验证依赖项
verify
您偶尔可能会遇到一个在软件包依赖项方面出现问题的系统。如果您的应用程序在显示缺少某些内容的错误消息的情况下无法启动,这是 zypper 需要检查的事情
$ rpm -e --nodeps mozilla-xulrunner190 $ firefox Could not find compatible GRE between version 1.9.0 and 1.9.0. $ zypper ve Reading installed packages... Some of the dependencies of installed packages are broken. In order to fix these dependencies, the following actions need to be taken: The following NEW package is going to be installed: mozilla-xulrunner190 Overall download size: 6.5 M. After the operation, additional 23.5 M will be used. Continue? [YES/no]: y
安装新的推荐软件包
install-new-recommends
此命令查找并安装您已安装的软件包新添加的推荐软件包。这提供了一种轻松获取软件的新语言包或新添加硬件的驱动程序的方法。
$ zypper inr Reading installed packages... The following NEW packages are going to be installed: kdebase4-openSUSE-lang bundle-lang-common-cs Overall download size: 534.0 K. After the operation, additional 1.9 M will be used. Continue? [YES/no]:
更新管理
对于使用稳定版本并希望通过在线更新仓库更新系统的用户来说,以下内容特别有用(有关软件包更新,请参阅 更新软件包)。更新仓库在系统安装或升级期间默认添加,或者可以通过 YaST 控制中心的“软件”选项卡中的在线更新配置手动添加,或者使用 zypper 手动添加。以下是 可用 openSUSE 更新仓库的列表。
YaST 的此功能的等效项是 模块。
列出更新
list-updates
要列出所有需要的补丁更新,请执行
$ zypper lu Reading installed packages... Patches Repository | Name | Version | Category | Status -----------------+--------------------+---------+-------------+------- Updates for 11.0 | KDE4-fixes | 38 | recommended | Needed Updates for 11.0 | MozillaFirefox | 50 | recommended | Needed Updates for 11.0 | NetworkManager-kde | 49 | recommended | Needed
有时仅列出影响软件包管理的更新,因为这些更新应首先应用。应用后,此命令将列出所有可用的更新。
此命令默认为 -t patch。要列出所有可用的软件包更新,请使用
zypper lu -t package
应用更新
update
要应用需要的补丁,请执行
$ zypper up Reading installed packages... The following packages are going to be upgraded: NetworkManager-kde mozilla-nss mozilla-nspr kde4-korganizer The following NEW patches are going to be installed: NetworkManager-kde MozillaFirefox KDE4-fixes Overall download size: 2.9 M. After the operation, additional 283.0 K will be used. Continue? [YES/no]:
列出补丁
patches
该list-updates命令仅列出需要的补丁。要列出所有可用的补丁,请使用
$ zypper patches Reading installed packages... Catalog | Name | Version | Category | Status -----------------+--------------------+---------+-------------+--------------- Updates for 11.0 | KDE4-fixes | 38 | recommended | Installed Updates for 11.0 | MozillaFirefox | 50 | recommended | Installed Updates for 11.0 | NetworkManager-kde | 49 | recommended | Installed Updates for 11.0 | autoyast2 | 37 | recommended | Installed Updates for 11.0 | courier-authlib | 42 | security | Not Applicable Updates for 11.0 | insserv | 47 | recommended | Installed Updates for 11.0 | opera | 43 | security | Installed
检查补丁
patch-check
此命令会告诉您系统是否有任何重要的补丁可用以及这些补丁的数量
$ zypper pchk Reading installed packages... 0 patches needed (0 security patches)
获取补丁信息
patch-info
info -t patch
$ zypper info -t patch MozillaFirefox Reading installed packages... Information for patch MozillaFirefox: Name: MozillaFirefox Version: 50 Arch: noarch Vendor: maint-coord@suse.de Status: Installed Category: recommended Created On: Thu 01 Jan 1970 01:00:00 AM CET Reboot Required: No Package Manager Restart Required: No Interactive: No Summary: Mozilla Firefox 3.0 Description: This patch updates Mozilla Firefox to the final 3.0 version. The dependend libraries mozilla-xulrunner190, mozilla-nspr and mozilla-nss were also brought to their release version.
在脚本和应用程序中使用 Zypper
Zypper 支持几种全局选项,使其适合在自动化流程(如脚本)中使用。此外,zypper 手册页中列出的几种不同的退出代码可以在自动化流程中使用 zypper 时进行检查。
非交互模式
--non-interactive
在此模式下,zypper 不会提示用户回答任何问题,而是使用默认答案。使用此选项时,保证 zypper 不会因在 stdin 上提示答案或陷入无限循环而挂起。
例如,要自动更新系统而无需确认,您可以键入
# zypper --non-interactive update
此命令不需要用户确认即可继续更新,跳过所有需要额外确认的交互式补丁,并自动回答任何其他提示。
无 GPG 检查模式
--no-gpg-checks
如果使用此选项,zypper 将始终选择继续,如果某些 gpg 检查失败,例如,仓库文件未签名应该签名,文件已签名并且 gpg 检查失败等。
自动同意许可协议
--auto-agree-with-licenses
这是 install、remove 和 update 命令的特殊选项。通过使用此选项,用户声明他/她同意该命令将安装的许可协议的条款,zypper 将自动对许可确认提示说“是”。这对于人们在多台机器上安装相同的软件包集(通过自动化流程)并阅读所有许可协议之前很有用。
安静输出
--quiet
避免显示过多的文本,例如进度信息,仅显示操作结果和错误消息。
XML 输出
--xmlout
此选项使 zypper 以 XML 格式进行通信。这允许脚本、图形前端或其他希望使用 zypper 的应用程序以定义明确的标准方式解析 zypper 的输出。zypper 的 XML 输出的 RNC 模式可在 此处 和在/usr/share/zypper/xml/xmlout.rnc.
可用。并非所有(但大部分)输出当前以 XML 形式显示;目标是将所有可能的输出都以 XML 形式显示。
提示
以下应该是 zypper 需要用户交互的完整列表,以及在非交互模式下使用的回复。此处提到的所有其他选项都优先于 --non-interactive,因此如果使用,它们所暗示的答案将自动使用,即使未使用 --non-interactive。
如果应用了 --no-gpg-checks,则会显示一条消息或将警告写入 stderr 并记录。
| prompt | 默认答案 | 在应用 --no-gpgp-checks 时 | 备注 |
|---|---|---|---|
| 接受未签名的文件? | N | Y | |
| 将密钥导入密钥环? | N | N | 只能在交互模式下导入新密钥 |
| 接受未知密钥? | N | Y | |
| 信任密钥? | N | Y | |
| 签名文件的验证失败,继续? | N | Y | |
| 文件没有摘要,继续? | N | Y | |
| 接受未知摘要? | N | Y |
其他提示
| prompt | 默认答案 | 其他答案 | 备注 |
|---|---|---|---|
| 继续安装/删除/更新? | Y | 此外,--no-confirm选项即使在没有全局--non-interactive | |
| 确认第三方许可 | N | Y 如果--auto-agree-with-licenses使用 | 此外,对于 zypper update,可以使用 --skip-interactive 选项从要安装的列表中排除交互式补丁(rug 的遗产) |
| 确认补丁消息 | Y | ||
| 在安装/删除可解析的内容时出现问题,中止/重试/忽略? | ABORT | 这很糟糕,将来可以改进 | |
| 在下载软件包时出现问题,中止/重试/忽略? | ABORT | 这也很糟糕,将来可以进行改进 | |
| 依赖冲突,#/s/r/c(解决方案编号、跳过、重试或取消) | c | 始终取消,需要用户交互才能解决依赖关系 | |
| 媒体更改请求 | ABORT | ||
| 删除有问题锁? | Y |
在 XML 输出中,提示由 <prompt> 标签指示,其中包含 id 属性。所有已知 ID 的枚举可在 zypper 随附的 prompt.h 包含文件中找到(/usr/include/zypper/prompt.h).
与 Rug 的兼容性
Zypper 的语法类似于 ,但其命令和选项集也已开始与 rug 多样化,以及其输出和行为。但是,zypper 也可以以与 rug 兼容的模式工作,并支持大多数 rug 命令。有关更多详细信息,请参阅man zypper,COMPATIBILITY WITH RUG 部分。