- Synchronize list of packages and versions available:zypper refresh- Install a new package:zypper install [package]- Remove a package:zypper remove [package]- Upgrade installed packages to newest available versions:zypper update- Search package via keyword:zypper search [keyword]
zypper [--global-opts] <command> [--command-opts] [command-arguments]
zypper help [command]
zypper is a command-line interface to ZYpp system management library. 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 intented to manipulate repositories. Also many commands and options take a repository as an arugment. See section COMMANDS, subsection Repository Management for more details.
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. For example: obs://server:http/openSUSE_11.3.
If platform is omitted, zypper.conf's obs.platform value is used. See also other options in the [obs] section of zypper.conf.
In addition to these URIs you can use plain directory and file paths in which case zypper automatically treats them as dir:/path URIs.
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 metada 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 only one type of services, the Repository Index Service (RIS).
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 is a package, patch, pattern, or a product.
package - an ordinary RPM package. patch - update of one or more packages. A patch can include special scripts and messages to be run or shown during installation of the update. pattern - group of packages required or recommended to install some functionality. product - group of packages which are necessary to install a product. srcpackage - source code package (.src.rpm). This type works in search and install commands.
Throughout this manual we will refer to resolvables simply as packages and to resolvable types as package types. These type names can be used as arguments of --type option in several commands like install, info, or search.
Software packages depend on each other in various ways. Packages usually require or recommend other packages, they can declare that they conflict with other packages, etc. Packages can also depend on specific hardware. See http://old-en.opensuse.org/Software_Management/Dependencies for more information. Zypper utilizes a dependency solver to find out what packages are needed to be installed according to user's request.
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.
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 be invoked in any of the following ways:
$ zypper help [command] $ zypper -h|--help [command] $ zypper [command] -h|--help
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.
For each specified package, zypper finds the best available version in defined repositories and shows information for this package.
Show information about package 'workrave': $ zypper info workrave
Show information about patch 'libzypp': $ zypper info -t patch libzypp
Show information about pattern 'lamp_server': $ zypper info -t pattern lamp_server
The packages can be selected by their name or by a capability they provide.
Capability is: NAME, or "NAME[.ARCH][OP<EDITION>]", where ARCH is architecture code, OP is <, <=, =, >=, 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 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 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 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
If pattern is specified, and the pattern is not yet installed, all packages required and recommended by the pattern will be installed. A pattern is considered installed if all the packages and patterns it requires are installed. Thus a pattern can be evalueated as installed even if you do not install the pattern itself, but rather the packages it requries. Use zypper search -t pattern [name] to look for available patterns and zypper info -t pattern <name> to list its contents.
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. Like patterns, patches can also be evaluated as installed by installing the packages needed to satisfy the patch. Use zypper list-patches to look for available needed patches and zypper info -t patch <name> to display detailed information about a patch.
If product is specified, zypper ensures all packages required by the product are installed. Use zypper se -t product [name] to look for available products and zypper info -t product <name> to display detailed information about a product.
The default behavior is 'force' in the interactive mode and 'no-force' in the non-interactive mode. If this option is specified, it takes the preference.
Install lamp_server pattern: $ zypper install -t pattern lamp_server
Install GhostScript viewer, but ignore recommended packages: $ zypper install --no-recommends gv
Install version 2.0.6 of virtualbox-ose package (any of the following): $ zypper install virtualbox-ose-2.0.6 $ zypper install virtualbox-ose=2.0.6 $ zypper install virtualbox-ose = 2.0.6
This command will try to find the newest available versions of the source packages and use 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:
$ zypper search -t srcpackage -r <alias|name|#|URI>
Install build dependencies of dbus-1 source package: $ zypper si -d dbus-1
In case that any dependency problems are found, zypper suggests packages to install or remove to fix them.
The packages can be selected by their name or by a capability they provide. For details on package selection see the install command description.
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 satisified, the patch is rendered installed.
Uninstallation of patterns is currently not implemented.
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.
If patch is specified, zypper acts as if the list-patches command was executed.
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.
If patch is specified, zypper acts as if the patche command was executed.
The default behavior is 'no-force'. If this option is specified, it takes the preference.
This command is similar to 'zypper list-updates -t patch'.
Note that since the arguments of some of the following options are not required, they must be specified using '=' instead of a space.
See also the EXIT CODES section for details on exit status of 0, 100, and 101 returned by this command.
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'.
If no repositories are specified via --from or --repo options, 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 older release repository after adding a new one, say openSUSE 11.1 and openSUSE 11.2.
To avoid the above trouble, you can specify the repositories from which to do the upgrade using the --from or --repo options. The difference between these two is that when --repo is used, zypper acts as if it knew only the specified repositories, while with --from zypper can eventually use also the rest of enabled repositories to satisfy package dependencies.
Upgrade the system using 'factory' and 'packman' repository: $ zypper install zypper libzypp $ zypper dup --from factory --from packman
Results of search are printed in a table with following columns: S (status), Catalog, Type (type of package), Name, Version, Arch (architecture). The status column can contain the following values: i - installed, v - another version installed, or an empty space for neither of the former cases.
The 'v' status is only shown if the version or the repository matters (--details or --repo is used), and the installed version differs from the one listed or is from a repository other than specified.
See also the type-specific query commands like packages, patterns, etc.
Search for YaST packages (quote the string to prevent the shell from expanding the wildcard): $ zypper se 'yast*'
Show all available versions of package 'kernel-default': $ zypper se -s --match-exact kernel-default
Look for RSI acronym (case-sensitively), also in summaries and descriptions: $ zypper se -dC --match-words RSI
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).
Add a new repository specified by URI and assign specified alias to it or specify URI to a .repo file.
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.
Add an HTTP repository, probe it, name it 'Packman 11.1 repo', and use 'packman' as alias: $ zypper ar -c -n 'Packman 11.1 repo' http://packman.iu-bremen.de/suse/11.1 packman
Add repositories from a repo file: $ zypper ar http://download.opensuse.org/repositories/zypp:/svn/openSUSE_Factory/zypp:svn.repo $ zypper ar myreposbackup.repo
Backup your repository setup: $ zypper repos -e myreposbackup.repo
List repositories with their URIs and priorities: $ zypper lr -pu
Rename repository number 8 to 'myrepo' (useful if the repo has some dreadful alias which is not usable on the command line). $ zypper nr 8 myrepo
Enable keeping of packages for all remote repositories: $ zypper mr -kt
Enable repository 'updates' and switch on autorefresh for the repo: $ zypper mr -er updates
Disable all repositories: $ zypper mr -da
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.
Newly added services are not refereshed 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 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.
Remove specified repository index service from the sytem.
Removing an RIS service will result in removing of all of its repositories.
RIS services add, remove, or modify repositories on your system based on current content of the repository index. Services only manage defined repositories, they do not refresh them. To refresh also repositories, use --with-repos option or the refresh command.
TODO more info
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.
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.
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 redistributiong a custom distribution (like appliances) to figure out what licenses they are bound by.
* 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
* Command line options * --config <file> * /etc/zypp/zypp.conf
See also FILES section for more information.
User's settings are prefered over global settings. Similarly, command line options override the settings in either of these files. Settings from zypp.conf (see below) having their counterparts in zypper.conf are overriden by zypper's values. To sum it up, the order of preference is as follows (from highest to lowest):
* Command line options * $HOME/.zypper.conf * /etc/zypp/zypper.conf * /etc/zypp/zypp.conf
See the comments in /etc/zypp/zypper.conf for a list and description of available options.
Options having their counterpart in zypper.conf are overriden by zypper's setting.
This file is used by all ZYpp-based applications.
This directory is used by all ZYpp-based applications.
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.
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.
zypper is designed to be compatible with rug, which is a command-line interface to the ZENworks Linux Management (ZLM) agent. Compared to rug, zypper does not need the ZLM daemon to run, and is intented to provide more and improved functionality. Following is a list of zypper-rug command aliases, supported rug command line options, and compatibility notes. See also compatibility notes in descriptions of zypper commands.
To enable rug-compatible behavior, use the -r or --rug-compatible global option with each command.
ZENworks uses different terminology than ZYpp. ZLM services are ZYpp's repositories and services. Additionally some ZLM services can contain catalogs (rpmmd-type repositories in ZYpp speak).
Zypper tries to mimick rug's behavior in its service handling commands when used with the -r global option. It also supports the --catalog option for specifying catalogs to work with in current operation (this is an alias for zypper's --repo option).
Martin Vidner <email@example.com> Duncan Mac-Vicar <firstname.lastname@example.org> Jan Kupec <email@example.com> Stanislav Visnovsky <firstname.lastname@example.org> Josef Reidinger <email@example.com>
rug(1), YaST2(8), locks(5)