zypper
Command-line interface to ZYpp system management library (libzypp)
- Provided by: zypper (Version: 1.12.4-1build0.1)
- Report a bug
Command-line interface to ZYpp system management library (libzypp)
zypper [--global-opts] command [--command-opts] [command-arguments]
zypper help command
zypper is a command-line interface to ZYpp system management library (libzypp). It can be used to install, update, remove software, manage repositories, perform various queries, and more.
Most of the following concepts are common for all applications based on the libzypp package management library, but there are some zypper specifics.
Libzypp works with package metadata, that is information about packages and their relations extracted from RPM packages and other data like patch information, pattern definitions, etc. These data are stored together with the RPM files in folders called repositories. Repositories can be placed on various media like an HTTP or FTP server, DVD, or a folder on a local disc.
There is a special set of commands in zypper intended to manipulate repositories. Also many commands and options take a repository as an argument. See section COMMANDS, subsection Repository Management for more details.
Zypp verifies the authenticity of repository metadata by checking their GPG signature. If the repository metadata are signed with a trusted key and and successfully verified, packages from that repository are accepted for installation if they match the checksum provided in the metadata. If the repository metadata are not signed, the signature of each downloaded rpm package is checked before accepting it for installation.
This default behavior can be tuned by explicitly setting the variables repo_gpgcheck and/or pkg_gpgcheck in the ZYpp configuration file (/etc/zypp/zypp.conf) to perform those checks always (if on) or never (if off).
Disabling GPG checks is not recommended. Signing data enables the recipient to verify that no modifications occurred after the data were signed. Accepting data with no, wrong or unknown signature can lead to a corrupted system and in extreme cases even to a system compromise.
To specify locations of repositories or other resources (RPM files, .repo files) you can use any type of URIs supported by libzypp. See section COMMANDS, subsection Repository Management for a complete list and usage examples.
Zypper also accepts special URIs identifying openSUSE Build Service (OBS) repositories in the addrepo command. These URIs have the form of obs://project/[platform], where project is the name of the OBS project and platform is the target platform (OS) for which the repository is intended. If platform is omitted, the obs.platform value from zypper.conf is used. See also other options in the [obs] section of zypper.conf.
For example: obs://server:http/openSUSE_11.3.
In addition to these URIs you can use plain directory and file paths in which case zypper automatically treats them as dir:/path URI.
Refreshing a repository means downloading metadata of packages from the medium (if needed), storing it in local cache (typically under /var/cache/zypp/raw/alias directory) and preparsing the metadata into .solv files (building the solv cache), typically under /var/cache/zypp/solv/alias.
The metadata get refreshed either automatically or on user request. An automatic refresh takes place right before reading metadata from the database if the auto-refresh is enabled for the repository and the metadata is reported to be out of date. If the auto-refresh is disabled, the repository will only be refreshed on user request. You can request a refresh by calling zypper refresh (see the documentation of the refresh command for details).
The repository metadata are checked for changes before actually doing the refresh. A change is detected by downloading one or two metadata index files (small files) and comparing the checksums of the cached ones and the remote ones. If the files differ, the repository is out of date and will be refreshed.
To delay the up-to-date check (and thus the automatic refresh) for a certain number of minutes, edit the value of the repo.refresh.delay attribute of ZYpp config file (/etc/zypp/zypp.conf). This means, zypper will not even try to download and check the index files, and you will be able to use zypper for operations like search or info without internet access or root privileges.
Services are one level above repositories and serve to manage repositories or to do some special tasks. Libzypp currently supports Repository Index Service (RIS) and Plugin Service.
Repository Index Service (RIS) is a special type of repository which contains a list of other repositories. This list can be generated dynamically by the server according to some URI parameters or user name, or can be static. Once such service is added to your system, zypper takes care of adding, modifying, or removing these repositories on your system to reflect the current list. See section Service Management and http://old-en.opensuse.org/Standards/Repository_Index_Service for more details.
Zypper works with several types of resource objects, called resolvables. A resolvable might be a package, patch, pattern, product; basically any kind of object with dependencies to other objects.
package
patch
pattern
product
srcpackage
application
Throughout this manual we will often refer to resolvables simply as packages and to resolvable types as package type or kind. These type names can be used as arguments of --type option in several commands like install, info, or search. Commands should also allow to specify resolvables as KIND:NAME (e.g. patch:openSUSE-2014-7).
Software packages depend on each other in various ways. Packages usually require or recommend other packages, but they can also conflict with other packages. Packages can also support specific hardware or language settings. Zypper uses a dependency solver to find out what packages need to be installed to satisfy the user’s request. See http://old-en.opensuse.org/Software_Management/Dependencies for more information.
File conflicts happen when two packages attempt to install files with the same name but different contents. This may happen if you are installing a newer version of a package without erasing the older version, of if two unrelated packages each install a file with the same name.
As checking for file conflicts requires access to the full filelist of each package being installed, zypper will check for file conflict only if all packages are downloaded in advance (see --download-in-advance).
As the reason for file conflicts usually is a poor package design or lack of coordination between the the people building the packages, they are not easy to resolve. By using the --replacefiles option you can force zypper to replace the conflicting files. Nevertheless this may damage the package whose file gets replaced.
zypper provides a number of commands. Each command accepts the options listed in the GLOBAL OPTIONS section. These options must be specified before the command name. In addition, many commands have specific options, which are listed in this section. These command-specific options must be specified after the name of the command and before any of the command arguments.
help [command]
If invoked with a command name argument, zypper displays help for the specified command, if such command exists. Long as well as short variants of the command names can be used.
For your convenience, zypper help can also be invoked in any of the following ways:
| $ zypper -h|--help [command] | |
| $ zypper [command] -h|--help |
shell (sh)
The shell support is not complete so expect bugs there. However, there’s no urgent need to use the shell since libzypp became so fast thanks to the SAT solver and its tools (openSUSE 11.0), but still, you’re welcome to experiment with it.
info (if) [options] name...
For each specified package, zypper finds the best available version in defined repositories and shows information for this package.
-r, --repo alias|name|#|URI
-t, --type type
--provides
--requires
--conflicts
--obsoletes
--recommends
--suggests
Examples:
$ zypper info workrave
$ zypper info -t patch libzypp
$ zypper info -t pattern lamp_server
install (in) [options] name|capability|rpm_file_uri...
The packages can be selected by their name or by a capability they provide.
A capability is formed by "NAME[.ARCH][ OP EDITION]", where ARCH is an architecture code, OP is one of <, <=, =, >=, or > and EDITION is "VERSION[-RELEASE]". For example: zypper=0.8.8-2 The NAME component of a capability is not only a package name but any symbol provided by packages: /bin/vi, libcurl.so.3, perl(Time::ParseDate). Just remember to quote to protect the special characters from the shell, for example: zypper\>0.8.10 or 'zypper>0.8.10'.
If EDITION is not specified, the newest installable version will be installed. This also means that if the package is already installed and newer versions are available, it will get upgraded to the newest installable version.
If ARCH is not specified, or the last dot of the capability name string is not followed by known architecture, the solver will treat the whole string as a capability name. If the ARCH is known, the solver will select a package matching that architecture and complain if such package cannot be found.
Zypper is also able to install plain RPM files while trying to satisfy their dependencies using packages from defined repositories. You can install a plain RPM file by specifying its location in the install command arguments either as a local path or an URI. E.g.:
$ zypper install ~/rpms/foo.rpm http://some.site/bar.rpm.
Zypper will report packages that it cannot find. Further, in interactive mode, zypper proceeds with installation of the rest of requested packages, and it will abort immediately in non-interactive mode. In both cases zypper returns ZYPPER_EXIT_INF_CAP_NOT_FOUND after finishing the operation.
Zypper will download the files into its cache directory (/var/cache/zypper/RPMS), add this directory as a temporary plaindir repository and mark the respective packages for installation.
In the install command, you can specify also packages you wish to remove in addition to the packages you wish to install, by prepending their names by a - or ~ character. For example:
$ zypper install vim -emacs
$ zypper remove emacs +vim
will both install vim and remove emacs. Note that if you choose to use - with the first package you specify, you need to write -- before it to prevent its interpretation as a command option:
$ zypper install — -boring-game great-game great-game-manual
-r, --repo alias|name|#|URI
Using --repo is discouraged as it currently hides unmentioned repositories from the resolver, leading to inexpertly decisions. In the future --repo will become an alias for --from.
-t, --type type
If patch is specified, zypper will install and/or remove packages to satisfy specified patch. This is a way to ensure that specific bug fix is installed. Use zypper list-patches to look for available needed patches.
If product or pattern are specified, zypper ensures that all required (and optionally recommended) packages are installed.
-n, --name
-f, --force
--oldpackage
--from alias|name|#|URI
-C, --capability
-l, --auto-agree-with-licenses
--debug-solver
--no-recommends
--replacefiles
-R, --no-force-resolution
--force-resolution
-D, --dry-run
--details
Download-and-install mode options:
-d, --download-only
--download-in-advance
--download-in-heaps
NOTE: While the resolver is not capable of building heaps, this behaves the same as --download-in-advance.
--download-as-needed
--download mode
Examples:
$ zypper install -t pattern lamp_server
$ zypper install --no-recommends gv
$ zypper install virtualbox-ose-2.0.6
$ zypper install virtualbox-ose=2.0.6
$ zypper install virtualbox-ose = 2.0.6
source-install (si) name...
This command will try to find the newest available versions of the source packages and uses rpm -i to install them and the packages that are required to build the source package.
Note that the source packages must be available in repositories you are using. You can check whether a repository contains any source packages using the following command:
-d, --build-deps-only
-D, --no-build-deps
-r, --repo alias|name|#|URI
--download-only
Examples:
$ zypper si -d dbus-1
verify (ve) [options]
In case that any dependency problems are found, zypper suggests packages to install or remove to fix them.
--no-recommends
-D, --dry-run
--details
-r, --repo alias|name|#|URI
--debug-solver
install-new-recommends (inr) [options]
-r, --repo alias|name|#|URI
-D, --dry-run
--details
--debug-solver
This command also accepts the Download-and-install mode options described in the install command.
remove (rm) [options] name...
remove (rm) [options] --capability capability...
The packages can be selected by their name or by a capability they provide. For details on package selection see the install command description.
-r, --repo alias|name|#|URI
-t, --type type
Since patches are not installed in sense of copying files or recording a database entry, they cannot be uninstalled, even though zypper shows them as installed. The installed status is determined solely based on the installed status of its required dependencies. If these dependencies are satisfied, the patch is rendered installed.
-n, --name
-C, --capability
--debug-solver
-R, --no-force-resolution
--force-resolution
-u, --clean-deps
-U, --no-clean-deps
-D, --dry-run
--details
list-updates (lu) [options]
This command will list only installable updates, i.e. updates which have no dependency problems, or which do not change package vendor. This list is what the update command will propose to install. To list all packages for which newer version are available, use --all option.
-t, --type type
If patch is specified, zypper acts as if the list-patches command was executed.
-r, --repo alias|name|#|URI
-a, --all
--best-effort
update (up) [options] [packagename]...
This command will not update packages which would require change of package vendor unless the vendor is specified in /etc/zypp/vendors.d, or which would require manual resolution of problems with dependencies. Such non-installable updates will then be listed in separate section of the summary as "The following package updates will NOT be installed:".
To update individual packages, specify one or more package names. You can use the * and ? wildcard characters in the package names to specify multiple packages matching the pattern.
-t, --type type
If patch is specified, zypper acts as if the patches command was executed.
-r, --repo alias|name|#|URI
--skip-interactive
--with-interactive
-l, --auto-agree-with-licenses
--debug-solver
--no-recommends
--replacefiles
-R, --no-force-resolution
--force-resolution
-D, --dry-run
--details
--best-effort
This command also accepts the download-and-install mode options described in the install command description.
list-patches (lp) [options]
This command is similar to zypper list-updates -t patch.
Note that optional arguments of some of the following options must be specified using = instead of a space.
-b, --bugzilla[=#]
--cve[=#]
--date YYYY-MM-DD
-g, --category category
--issues[=string]
-a, *--all
-r, --repo alias|name|#|URI
patch-check (pchk)
See also the EXIT CODES section for details on exit status of 0, 100, and 101 returned by this command.
-r, --repo alias|name|#|URI
patch [options]
If there are patches that affect the package management itself, those will be installed first and you will be asked to run the patch command again.
This command is similar to zypper update -t patch.
-b, --bugzilla #
--cve #
--date YYYY-MM-DD
-g, --category category
-r, --repo alias|name|#|URI
--skip-interactive
--with-interactive
-l, --auto-agree-with-licenses
--no-recommends
--replacefiles
--debug-solver
-D, --dry-run
--details
This command also accepts the download-and-install mode options described in the install command description.
dist-upgrade (dup) [options]
If no repositories are specified via the --from option, zypper will do the upgrade with all defined repositories. This can be a problem if the system contains conflicting repositories, like repositories for two different distribution releases. This often happens if one forgets to remove an older release repository after adding a new one, say openSUSE 13.1 and openSUSE 13.2.
For all repositories which have the distribution version within their URL (like http://download.opensuse.org/distribution/13.1/repo/oss) using the $releasever variable instead may be helpful (http://download.opensuse.org/distribution/$releasever/repo/oss). The variable is per default substituted by the current distributions version (13.1) This value can be overwritten using the --releasever global option. Calling zypper --releasever 13.2... will cause these repos to use the new location (http://download.opensuse.org/distribution/13.2/repo/oss) without need to add/remove anything. Once the dup is performed, $releasever will default to the new distribution version. See section Repository Management for more info about variable substitution.
Note: distribution upgrades in openSUSE are currently only supported between consecutive releases. To upgrade multiple releases, upgrade each consecutive release one at a time. For more details see http://en.opensuse.org/SDB:System_upgrade and the openSUSE release notes at http://doc.opensuse.org/release-notes/.
--from alias|name|#|URI
-r, --repo alias|name|#|URI
Using --repo is discouraged as it currently hides unmentioned repositories from the resolver, leading to inexpertly decisions. In the future --repo will become an alias for --from.
-l, --auto-agree-with-licenses
--no-recommends
--replacefiles
--debug-solver
-D, --dry-run
--details
This command also accepts the download-and-install mode options described in the install command description.
Examples:
$ zypper dup --from factory --from packman
search (se) [options] [querystring|capability]...
Results of the search are printed in a table. with columns Status, Name, Type of package, Version, Architecture and Repository. The Status column can contain the following values:
| i | installed |
| v | a different version is installed |
| empty | neither of the former cases |
The v status is only shown if the version or the repository matters (see --details or --repo), and the installed version differs from the one listed or is from a repository other than specified.
This command accepts the following options:
--match-substrings
--match-words
--match-exact
--provides
--requires
--recommends
--suggests
--conflicts
--obsoletes
-n, --name
-f, --file-list
-d, --search-descriptions
-C, --case-sensitive
-i, --installed-only
-u, --uninstalled-only
-t, --type type
See also the type-specific query commands like packages, patterns, etc.
-r, --repo alias|name|#|URI
--sort-by-name
--sort-by-repo
-s, --details
-v, --verbose
Examples:
$ zypper se 'yast*'
$ zypper se -s --match-exact kernel-default
$ zypper se -dC --match-words RSI
packages (pa) [options] [repository]...
-r, --repo alias|name|#|URI
-i, --installed-only
-u, --uninstalled-only
--orphaned
--suggested
--recommended
--unneeded
patches (pch) [options] [repository]...
-r, --repo alias|name'|#|URI
patterns (pt) [options] [repository]...
-r, --repo alias|name|#|URI
-i, --installed-only
-u, --uninstalled-only
products (pd) [options] [repository]...
-r, --repo 'alias|name|#|URI
-i, --installed-only
-u, --uninstalled-only
what-provides (wp) capability
The command line is automatically transformed into the appropriate search command, e.g.:
$ zypper what-provides 'zypper>1.6'
$ zypper se --provides --match-exact 'zypper>1.6'
Zypper is able to work with YaST, RPM-MD (yum) software repositories, and plain directories containing .rpm files.
Repositories are primarily identified using their URI or alias. Alias serves as a shorthand for the long URI or name of the repository. The name of the repository should briefly describe the repository and is shown to the user in tables and messages. The name is not required, and if not known, the alias is shown instead. The alias is required and uniquely identifies the repository on the system.
The alias, name, URI, or the number from zypper repos list can be used to specify a repository as an argument of various zypper commands and options like refresh, --repo, or --from.
Apart from the above, repositories have several other properties which can be set using the commands described in this section below, or by manually editing the repository definition files (.repo files, see section FILES).
Variable substitution:
You can use the following built-in variables within a .repo or .service files name and URI values:
$arch
$basearch
$releasever, $releasever_major, $releasever_minor
This is useful for related repositories like packman (http://ftp.gwdg.de/pub/linux/packman/suse/$releasever), which shall always fit the installed distribution, even after a distribution upgrade. To help performing a distribution upgrade, the value of $releasever can be overwritten using the --releasever global option. This way you can easily switch all repositories using $releasever to the new version (provided the server layouts did not change and new repos are already available).
In addition $releasever_major will be set to the leading portion up to (but not including) the 1st dot; $releasever_minor to the trailing portion after the 1st dot. If there’s no dot in $releasever, $releasever_major is the same as $releasever and $releasever_minor is empty.
Remember to protect the $ when using these variables on a shell command line:
If a variable is followed by an alphanumeric character or underscore it needs to be enclosed in {}:
Bash style definition of default ${variable:-word} and alternate ${variable:+word} values:
To check where you already use $releasever call:
Supported URI formats:
scheme: [//[user[:password]@]host[:port]] /path [?query] [#fragment]
CD or DVD drive
| cd:/// | |
| dvd:/subdir?devices=/dev/sr0,/dev/sr1 |
FTP/HTTP/HTTPS directory tree
Explicit proxy settings may be passed via optional parameters proxy, proxyport, proxyuser and proxypass.
HTTP authentication methods to use can be defined as comma separated list via optional parameter auth. Valid methods are e.g. basic, digest, ntlm, negotiate. Note, that this list depends on the list of methods supported by the curl library.
| ftp://user:pass@server/path/to/media/dir | |
| ftp://user:pass@server/%2fhome/user/path/to/media/dir | |
| http://user:pass@server/path | |
| https://user:pass@server/path?proxy=foo&proxyuser=me&proxypass=pw |
Disk volume (partition)
Local directory tree
Media in an ISO image (loopback mounted)
Mandatory iso parameter specifying the name of the iso file. Optional url parameter specifying the URL to the directory containing the iso file. Optional mnt parameter specifying the preferred attach point for the source media url. Optional filesystem name of the filesystem used in the iso file. Defaults to "auto".
| iso:/?iso=CD1.iso&url=nfs://server/path/to/media | |
| iso:/?iso=CD1.iso&url=hd:/?device=/dev/hda | |
| iso:/subdir?iso=DVD1.iso&url=nfs://nfs-server/directory&mnt=/nfs/attach/point&filesystem=udf |
NFS exported directory tree
| nfs://nfs-server/exported/path | |
| nfs://nfs-server/exported/path?mountoptions=ro&type=nfs4 | |
| nfs4://nfs-server/exported/path?mountoptions=ro |
CIFS/SMB directory tree
Optional workgroup or domain parameter set the name of the workgroup. As alternative to passing username:password in the URI authority the parameters user and pass can be used.
| smb://servername/share/path/on/the/share | |
| cifs://usern:passw@servername/share/path/on/the/share?mountoptions=ro,noguest | |
| cifs://usern:passw@servername/share/path/on/the/share?workgroup=mygroup | |
| cifs://servername/share/path/on/the/share?user=usern&pass=passw |
OpenSUSE Build Build Service (OBS) repositories
If platform is omitted, openSUSE_$releasever is used unless a value for obs.platform is defined in zypper.conf. If you are following openSUSE_Factory or openSUSE_Tumbleweed you may need to set these as your default platform. But we can only guess, how the directory containing the repository that fits your distribution is named on the server. In case of doubt you need to look up the right URL in a browser.
| obs://zypp:Head/ | |
| obs://zypp:Head/openSUSE_Factory | |
| obs://zypp:Head/openSUSE_Factory_Staging_Gcc49_standard |
addrepo (ar) [options] URI alias
addrepo (ar) [options] FILE.repo
Newly added repositories have auto-refresh disabled by default (except for repositories imported from a .repo, having the auto-refresh enabled). To enable auto-refresh, use the --refresh option of the modifyrepo command.
Also, this command does not automatically refresh the newly added repositories. The repositories will get refreshed when used for the first time, or you can use the refresh command after finishing your modifications with *repo commands. See also METADATA REFRESH POLICY section for more details.
-r, --repo file.repo
-t, --type type
| yast2 | susetags, yast, YaST, YaST2, YAST |
| rpm-md | repomd, rpmmd, yum, YUM |
| plaindir | Plaindir |
-d, --disable
-c, --check
-C, --nocheck
-n, --name
-k, --keep-packages
-K, --no-keep-packages
-f, --refresh
Examples:
$ zypper ar -c -n 'Packman 11.1 repo' http://packman.iu-bremen.de/suse/11.1 packman
$ zypper ar http://download.opensuse.org/repositories/zypp:/svn/openSUSE_Factory/zypp:svn.repo
$ zypper ar myreposbackup.repo
removerepo (rr) [options] alias|name|#|URI...
--loose-auth
--loose-query
repos (lr) [options] [repo]...
The following data can be printed for each repository found on the system: # (repository number), Alias (unique identifier), Name, Enabled (whether the repository is enabled), GPG Check (whether GPG check for repository metadata (r) and/or downloaded rpm packages (p) is enabled), Refresh (whether auto-refresh is enabled for the repository), Priority, Type (repository meta-data type: rpm-md, yast2, plaindir). Which of the data is shown is determined by command line options listed below and the main.repoListColumns setting from zypper.conf. By default, #, Alias, Name, Enabled, GPG Check and Refresh is shown.
Repository number is a unique identifier of the repository in current set of repositories. If you add, remove or change a repository, the numbers may change. Keep that in mind when using the numbers with the repository handling commands. On the other hand, using the alias instead of the number is always safe.
To show detailed information about specific repositories, specify them as arguments, either by alias, name, number from simple zypper lr, or by URI; e.g. fB zypper lr factory, or zypper lr 2.
-e, --export FILE.repo|-
-a, --alias
-n, --name
-u, --uri
-p, --priority
-r, --refresh
-d, --details
-E, --show-enabled-only
-U, --sort-by-uri
-P, --sort-by-priority
-A, --sort-by-alias
-N, --sort-by-name
Examples:
$ zypper repos -e myreposbackup.repo
$ zypper lr -pu
renamerepo (nr) alias|name|#|URI new-alias
Examples:
$ zypper nr 8 myrepo
modifyrepo (mr) options alias|name|#|URI...
modifyrepo (mr) options --all|--remote|--local|--medium-type
-e, --enable
-d, --disable
-r, --refresh
-R, --no-refresh
-p, --priority positive-integer
-n, --name
-k, --keep-packages
-K, --no-keep-packages
-a, --all
-l, --local
-t, --remote
-m, --medium-type type
Examples:
$ zypper mr -kt
$ zypper mr -er updates
$ zypper mr -da
refresh (ref) [alias|name|#|URI]...
See also METADATA REFRESH POLICY section for more details.
-f, --force
-b, --force-build
-d, --force-download
-B, --build-only
-D, --download-only
-s, --services
clean (cc) [options] [alias|name|#|URI]...
-m, --metadata
-M, --raw-metadata
-a, --all
The services, addservice, removeservice, modifyservice, and refresh-services commands serve for manipulating services. A service is specified by its URI and needs to have a unique alias defined (among both services and repositories).
Standalone repositories (not belonging to any service) are treated like services, too. The ls command will list them, ms command will modify them, etc. Repository specific options, like --keep-packages are not available here, though. You can use repository handling commands to manipulate them.
addservice (as) [options] URI alias
Newly added services are not refreshed automatically. Use the refresh-services command to refresh them. Zypper does not access the service URI when adding the service, so the type of the services is unknown until it is refreshed.
This command also allows one to add also ordinary repositories when used with --type option, where you specify the type of the repository. See the addrepo command for the list of supported repository types.
-t, --type type
| ris | RIS, nu, NU |
-d, --disable
-n, --name
removeservice (rs) [options] alias|name|#|URI...
--loose-auth
--loose-query
modifyservice (ms) options alias|name|#|URI
modifyservice (ms) options --all|--remote|--local|--medium-type
Common Options
-d, --disable
-e, --enable
-r, --refresh
-R, --no-refresh
-n, --name
-a, --all
-l, --local
-t, --remote
-m, --medium-type type
RIS Service Specific Options
-i, --ar-to-enable alias
-I, --ar-to-disable alias
-j, --rr-to-enable alias
-J, --rr-to-disable "alias'
-k, --cl-to-enable
-K, --cl-to-disable
services (ls) [options]
-u, --uri
-p, --priority
-d, --details
-r, --with-repos
-P, --sort-by-priority
-E, --show-enabled-only
-U, --sort-by-uri
-N, --sort-by-name
refresh-services (refs) [options] alias|name|#|URI...
RIS services add, remove, or modify repositories on your system based on current content of the repository index. A differing enabled/disabled state caused by manually calling modify-repo on a service repository however will not be reverted unless the --restore-status option is used, or the repository index explicitly requests the change.
Services only manage defined repositories, they do not refresh them. To refresh also repositories, use --with-repos option or the refresh command.
-f, --force
-r, --with-repos
-R, --restore-status
Package locks serve the purpose of preventing changes to the set of installed packages on the system. The locks are stored in form of a query in /etc/zypp/locks file (see also locks(5)). Packages matching this query are then forbidden to change their installed status; an installed package can’t be removed, not installed package can’t be installed. When requesting to install or remove such locked package, you will get a dependency problem dialog.
locks (ll)
addlock (al) [options] package-name...
-r, --repo alias|name|#|URI
-t, --type type
removelock (rl) [options] lock-number|package-name...
-r, --repo alias|name|#|URI
-t, --type type
cleanlocks (cl)
This command looks for locks that do not currently (with regard to repositories used) lock any package and for each such lock it asks user whether to remove it.
versioncmp (vcmp) version1 version2
The default output is in human-friendly form. If --terse global option is used, the result is an integer number, negative/positive if version1 is older/newer than version2, zero if they match.
-m, --match
For example:
$ zypper vcmp -m 0.15.3 0.15.3-2
$ zypper vcmp 0.15.3 0.15.3-2
targetos (tos)
licenses
First, a list of all packages and their licenses and/or EULAs is shown. This is followed by a summary, including the total number of installed packages, the number of installed packages with EULAs that required a confirmation from the user. Since the EULAs are not stored on the system and can only be read from repository metadata, the summary includes also the number of installed packages that have their counterpart in repositories. The report ends with a list of all licenses uses by the installed packages.
This command can be useful for companies redistributing a custom distribution (like appliances) to figure out what licenses they are bound by.
download
Per default packages are downloaded to the libzypp package cache (/var/cache/zypp/packages; for non-root users $XDG_CACHE_HOME/zypp/packages), but this can be changed by using the global --pkg-cache-dir option.
Parsable XML-output produced by zypper --xmlout will include a <download-result> node for each package zypper tried to download. Upon success the location of the downloaded package is found in the path attribute of the <localfile> subnode (xpath: download-result/localpath@path):
<download-result>
<solvable>
<kind>package</kind>
<name>zypper</name>
<edition epoch="0" version="1.9.17" release="26.1"/>
<arch>x86_64</arch>
<repository name="repo-oss-update (13.1)" alias="openSUSE:repo-oss-update"/>
</solvable>
<localfile path="/var/cache/zypp/packages/openSUSE:repo-oss-update/x86_64/zypper-1.9.17-26.1.x86_64.rpm"/>
</download-result>
--all-matches
--dry-run
source-download
-d, --directory dir
--delete
--no-delete
--status
ps
| PID | ID of the process |
| PPID | ID of the parent process |
| UID | ID of the user running the process |
| Login | Login name of the user running the process |
| Command | Command used to execute the process |
| Service | Guessed name of the service. If an init script exists for this service, you can do "rcservicename restart" to restart it. |
| Files | The list of the deleted files |
-h, --help
-V, --version
-c, --config file
See also FILES section for more information.
-v, --verbose
-q, --quiet
--[no-]color
-A, --no-abbrev
-t, --terse
-s, --table-style
-n, --non-interactive
-x, --xmlout
-i, --ignore-unknown
-D, --reposd-dir dir
-C, --cache-dir dir
--raw-cache-dir dir
--solv-cache-dir dir
--pkg-cache-dir dir
--userdata string
Repository Options:
--no-gpg-checks
--gpg-auto-import-keys
-p, --plus-repo URI
--plus-content tag
--disable-repositories
--no-refresh
--no-cd
--no-remote
--releasever version
To check where you already use $releasever call:
Target Options:
-R, --root dir
--disable-system-resolvables
/etc/zypp/zypper.conf, $HOME/.zypper.conf
User’s settings are preferred over global settings. Similarly, command line options override the settings in either of these files. To sum it up, the order of preference is as follows (from highest to lowest):
See the comments in /etc/zypp/zypper.conf for a list and description of available options.
/etc/zypp/zypp.conf
/etc/zypp/locks
This file is used by all ZYpp-based applications.
/etc/zypp/repos.d
You can use the --reposd-dir global option to use an alternative directory for this purpose or the --root option to make this directory relative to the specified root directory.
This directory is used by all ZYpp-based applications.
/etc/zypp/services.d
This directory is used by all ZYpp-based applications.
/var/cache/zypp/raw
This directory is used by all ZYpp-based applications.
/var/cache/zypp/solv
This directory is used by all ZYpp-based applications.
/var/cache/zypp/packages
This directory is used by all ZYpp-based applications.
/var/log/zypp/history
~/.zypper_history
There are several exit codes defined for zypper for use e.g. within scripts. These codes are defined in header file src/zypper-main.h found in zypper source package. Codes from interval (1-5) denote an error, numbers (100-105) provide a specific information, 0 represents a normal successful run. Following is a list of these codes with descriptions.
0 - ZYPPER_EXIT_OK
1 - ZYPPER_EXIT_ERR_BUG
2 - ZYPPER_EXIT_ERR_SYNTAX
3 - ZYPPER_EXIT_ERR_INVALID_ARGS
4 - ZYPPER_EXIT_ERR_ZYPP
5 - ZYPPER_EXIT_ERR_PRIVILEGES
6 - ZYPPER_EXIT_NO_REPOS
7 - ZYPPER_EXIT_ZYPP_LOCKED
100 - ZYPPER_EXIT_INF_UPDATE_NEEDED
101 - ZYPPER_EXIT_INF_SEC_UPDATE_NEEDED
102 - ZYPPER_EXIT_INF_REBOOT_NEEDED
103 - ZYPPER_EXIT_INF_RESTART_NEEDED
104 - ZYPPER_EXIT_INF_CAP_NOT_FOUND
105 - ZYPPER_EXIT_ON_SIGNAL
https://github.com/openSUSE/zypper
Martin Vidner <mvidner@suse.cz> Jan Kupec <> Michael Andres <ma@suse.de> Duncan Mac-Vicar <dmacvicar@suse.de> Josef Reidinger <jreidinger@suse.cz> Stanislav Visnovsky <visnov@suse.cz>