ZYPPER(8)
๐ ZYPPER(8) ๐
okay bestie, welcome to the zypper manual page โ the ZYPPER(8) one, no cap. This is your group-chat walkthrough of the command-line interface to the ZYpp system management library (libzypp), and yes, itโs giving โpowerful package manager energyโ โจ
๐ธ NAME ๐ธ
zypper โ command-line interface to the ZYpp system management library (libzypp) ๐ซถ
โจ SYNOPSIS โจ
zypper [--global-opts] command [--command-opts] [command-arguments]
zypper subcommand [--command-opts] [command-arguments]
zypper help command
๐ DESCRIPTION ๐
So like, zypper is a command-line interface to the ZYpp system management library (libzypp). It can be used to install, update, remove software, manage repositories, perform various queries, and more. Literally the whole package-management main-character package ๐
๐ฆ Transactional systems ๐ฆ
On a transactional system where the root filesystem is mounted read-only, zypper commands that modify the system cannot be executed directly. Thatโs the vibe check: read-only root means no direct writes, bestie.
If the system provides a transactional-wrapper utility, zypper will automatically attempt to invoke it. The wrapper transparently executes the zypper command within a new, writable snapshot and manages the lifecycle of that snapshot based on the commandโs exit status. Slay.
On transactional systems lacking a transactional-wrapper, users must manually invoke specialized tools โ such as transactional-update โ to install, update, or remove software. Periodt.
๐ CONCEPTS ๐
Most of the following concepts are common for all applications based on the libzypp package management library, but there are some zypper specifics. Buckle up, bestie ๐
๐ System Packages ๐
The set of installed packages on a system is sometimes denoted as repository @System or System Packages. In contrast to available repositories providing packages which can be installed, @System provides packages which can only be deleted. Installed packages which are not provided by at least one of the available repositories (neither in different version or as renamed package) are often denoted as being unwanted, orphaned or dropped. ๐ญ
Note: If you install packages which are not shipped within a repository โ manually built or downloaded ones โ collect them within a local directory and add this directory as a plaindir repository to your system. This way the packages will not be seen as being orphaned and are protected during a dist-upgrade. ๐ซถ
Creating such a plaindir repo is quite easy:
$ mkdir /LocalRepo
$ zypper addrepo --refresh /LocalRepo LocalRepo
If you need to make sure the package to install is taken from LocalRepo, simply use a REPO:PACKAGE style argument:
$ cp example.rpm /LocalRepo
$ zypper install LocalRepo:example
Depending on the kind of packages you keep in a local repo you may want to adjust the way GPG signature checks are performed. See section GPG checks for details. ๐
๐ง Repositories ๐ง
libzypp works with repository metadata โ this 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. Very โchoose your own adventure,โ honestly ๐ธ
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. iykyk ๐
๐ GPG checks ๐
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. Like, do not play with this, bestie ๐
Zypp verifies the authenticity of repository metadata by checking their GPG signature. If the repository metadata are signed with a trusted key and successfully verified, packages from this repository are accepted for installation if they match the checksum provided in the metadata. Using unsigned repositories needs to be confirmed.
If the repository metadata are not signed, the GPG signature of each downloaded rpm package is checked before accepting it for installation. Packages from unsigned repositories need a valid GPG signature. Using unsigned packages needs to be confirmed.
The above is the default behavior defined by settings in /etc/zypp/zypp.conf. ๐ซถ
The addrepo and modifyrepo commands provide further options to tune the behavior per repository. It is for example possible to relax the need to confirm installing unsigned packages for a specific repository. But if you do so, you should be very certain that an attacker can hardly modify the package data within the repository or on the way to your machine. See section COMMANDS for details about the command options. ๐ฅ
๐ฆ Resource Identifiers (URI) ๐ฆ
To specify locations of repositories or other resources (RPM files, .repo files) you can use any type of URI supported by libzypp. In addition Zypper accepts a special URI identifying openSUSE Build Service (OBS) repositories in the addrepo command. These URIs have the form of obs://project/[platform]. โจ
See section COMMANDS, subsection Repository Management for a complete list and examples of supported URI formats.
๐ธ Refresh ๐ธ
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. Itโs like a little metadata glow-up ๐
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.
HINT: zypper -vv ref will show the mirrors used to download the metadata. ๐
๐ง Services ๐ง
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 https://en.opensuse.org/openSUSE:Standards_Repository_Index_Service for more details. ๐
๐ Package Types ๐
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. Main character energy for every package type, honestly ๐
packageโ An ordinary RPM package. ๐patchโ A released patch conflicts with the affected/vulnerable versions of a collection of packages. As long as any of these affected/vulnerable versions are installed, the conflict triggers and the patch is classified as needed, or as unwanted if the patch is locked.
Selecting the patch, the conflict is resolved by updating all installed and affected/vulnerable packages to a version providing the fix. When updating the packages zypper always aims for the latest available version. Resolved patches are classified as either applied or not needed, depending on whether they refer to actually installed packages.
So installation, update or removal of packages may change the classification of patches referring to these packages. Since libyzpp-17.23.0 the /var/log/zypp/history remembers if a committed transaction changes a patchโs classification. If history data are available, patch tables show a column telling since when the patch is in its current state. ๐ซถ
Depending on the kind of defect, patches are classified by category and severity. Commonly used values for category are security, (recommended, bugfix), (optional, feature, enhancement) document or yast. Commonly used values for severity are critical, important, moderate, low or unspecified. Names listed in parentheses are used synonymously.
Note that the patch command does not apply optional patches (category optional or feature) by default. If you actually want to consider all optional patches as being needed, say patch --with-optional. Specific patches can be applied using the install command (e.g. zypper install patch:openSUSE-2014-7). โจ
If the issuer decides to retract a released patch, the patch status will be shown as retracted. The packages provided by the retracted patch are still visible but also tagged as having been retracted (R). The resolver will avoid selecting retracted packages automatically. If you are sure that a retracted package should be installed on your system, you must explicitly select it. No cap: explicit means explicit, bestie ๐
patternโ A group of packages required or recommended to install some functionality. ๐productโ A group of packages which are necessary to install a product. ๐srcpackageโ Source code package (.src.rpm). This type works insearchandinstallcommands. ๐งapplicationโ Legacy: Sincelibzypp-17.7.0this type is no longer available. ๐
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 one to specify resolvables as KIND:NAME (e.g. patch:openSUSE-2014-7). ๐
๐ Package Dependencies ๐
Software packages depend on each other in various ways. Packages usually require or recommend other packages, but they can also conflict with them. Packages may support specific hardware or language settings. Zypper uses a dependency solver to find out which packages need to be installed to satisfy the userโs request. Itโs giving โmatchmaker, but for packagesโ ๐
If you don't ask for a specific version of a package, the solver just picks a reasonable one for you. Its whole general attitude when resolving a job is: install the best version of the thing you asked for, and add or update dependencies as needed. That's Focus on Job, and it's the default. But bestie, there are two other focus modes ๐
In Focus on Installed mode, the solver is on a don't-touch-my-stuff vibe โ it focuses on making as few changes to the installed packages as possible. Picking an older version of the package you requested is totally valid here, as long as its dependencies require fewer changes to the system. The solver will try to avoid updating already installed packages. Lowkey respectful tbh.
In Focus on Update mode the solver goes the opposite way โ it focuses on updating the requested package and all its dependencies as much as it possibly can. โ ๏ธ Beware though: installing a single package in this mode may easily lead to a mini system update. Not a drill.
For a single command you can set the focus mode with the --solver-focus MODE switch. Valid modes are Job, Installed or Update. And if you wanna change the default mode for your whole system, set [/etc/zypp/zypp.conf:solver.focus] to whatever value your heart desires. ๐ซถ
๐ธ Automatically installed packages
Packages that the dependency solver adds in order to resolve a user's request are remembered as having been automatically installed. They may later get removed, if no more user-installed packages depend on them (like, say, via zypper remove --clean-deps). Bye boo ๐
In the Status column, the search command distinguishes between user-installed packages (i+) and automatically installed packages (i). Tiny letters, big meaning. โจ
๐ Package File Conflicts
File conflicts happen when two packages attempt to install files with the same name but different contents. This may happen if you're installing a newer version of a package without erasing the older version, or if two unrelated packages each install a file with the same name. Messy.
Since checking for file conflicts requires access to the full filelist of each package being installed, zypper will be able to check for file conflicts only if all packages are downloaded in advance (see --download-in-advance). If you're doing a --dry-run, no packages are downloaded, so the file conflict check will skip packages not available in the packages cache. To get a meaningful file conflict check, use --dry-run together with --download-only. Pro tip unlocked ๐
Because the reason for file conflicts is usually a poor package design or a lack of coordination between 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. ๐ญ Like, genuinely, tread carefully.
โจ COMMANDS โจ
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. Order matters, bestie โ it's giving "read the room" but for flags. ๐
Zypper also provides limited support for writing extensions/subcommands in any language. See section SUBCOMMANDS for details. Yes, any language. Go off. ๐
๐ General Commands
help [command]
Shows help texts. If invoked without any argument (just zypper or zypper help), zypper displays the global help text, which lists all available global options and commands. It's literally the map of the whole thing. ๐บ๏ธ
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 โ both are valid, no cap.
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)
Starts a shell for entering multiple commands in one session. Exit the shell using exit, quit, or Ctrl+D. Cozy little command home. ๐
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. Have fun, be safe.
๐ฆ Package Management Commands
info (if) [options] name[-version[-release]]...
Show detailed information for specified packages. By default, only packages that exactly match the provided names are shown. To include packages that partially match, use the --match-substrings option or wildcards (* or ?) within the name. Yes, the ? is doing real work here.
If no version constraint is specified, information about the best available package is shown. Note that both the version and release numbers must always match exactly. No fuzzy matching on those, sorry. ๐ฏ
If a query returns no results, zypper returns ZYPPER_EXIT_INF_CAP_NOT_FOUND unless the global option --ignore-unknown is set.
-s,--match-substringsโ Include packages that partially match the provided names.-r,--repoalias|name|#|URI โ Work only with the repository specified by the alias, name, number or URI. This option can be used multiple times.-t,--typetype โ Type of package (default:package). See section Package Types for list of available package types.--providesโ Show symbols the package provides.--requiresโ Show symbols the package requires.--conflictsโ Show symbols the package conflicts with.--obsoletesโ Show symbols the package obsoletes.--recommendsโ Show symbols the package recommends.--suggestsโ Show symbols the package suggests.--supplementsโ Show symbols the package supplements.--enhancesโ Show symbols the package enhances.
Examples, because we love a demo โจ:
$ zypper info workrave
Show information about package workrave
$ zypper info -t patch libzypp
Show information about patch libzypp
$ zypper info -t pattern lamp_server
Show information about pattern lamp_server
install (in) [options] name|capability|rpm_file_uri...
Install or update packages. The main character command, honestly. ๐
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
NAMEcomponent 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.10or'zypper>0.8.10'. Your shell will absolutely eat those characters otherwise. ๐ - If
EDITIONis 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. Glow-up time. โญ - If
ARCHis not specified, or the last dot of the capability name string is not followed by a known architecture, the solver will treat the whole string as a capability name. If theARCHis known, the solver will select a package matching that architecture and complain if such package cannot be found. It will let you know, loudly. - If you want to make sure a package from a specific
REPOSITORYis picked, useREPOSITORY:PACKAGENAMEas argument.
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 the 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 collect the files in a temporary plaindir repository and mark the respective packages for installation. If --download-only is used, the downloaded packages will be available in /var/cache/zypper/RPMS until you actually install them or call zypper clean to clear the package caches. They will not become part of the global package cache at /var/cache/zypp/packages (see also the global --pkg-cache-dir option). Different cache, bestie, don't mix them up. ๐
In the install command, you can also specify packages you wish to remove by prepending their names with a - or ! character. For example:
$ zypper install \!Firefox
In contrast to zypper remove Firefox, which removes Firefox and its dependent packages, the install command will try to keep dependent packages installed by looking for Firefox alternatives. It's giving "we're not breaking up the friend group" energy. ๐ซถ
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,--repoalias|name|#|URI โ Work only with the repository specified by the alias, name, number or URI. This option can be used multiple times.
Using--repois discouraged, as it currently hides unmentioned repositories from the resolver, leading to inexpertly decisions. In the future--repowill become an alias for--from.
If you want to install a package from a specific repository, use REPOSITORY:PACKAGENAME as argument.
-t,--typetype โ Type of package to install (default:package). See section Package Types for list of available package types. Usezypper se -t type [name]to look for available items of this type andzypper info -t type nameto display more detailed information about the item.
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 applicable patches.
If product or pattern are specified, zypper ensures that all required (and optionally recommended) packages are installed.
-n,--nameโ Select packages by their name, don't try to select by capabilities. Straight to the point. ๐ฏ-f,--forceโ Install even if the item is already installed (reinstall), downgraded or changes vendor or architecture. Zero hesitation, full send. ๐ฅ--oldpackageโ bestie this one lets you swap a newer item out for an older one. It's giving rollback energy, fr fr. And here's the tea: unlike--force, it will not force a reinstall if the item is already sitting there installed with the exact version you asked for. Respectful. ๐--fromalias|name|#|URI โ pick your packages from the repository you name here. If the strings you passed as arguments to theinstallcommand match packages in the repos listed in this option, they get marked for installation. Rn this option implies--name, but it still lets you use wildcards when specifying packages. Cute.-C,--capabilityโ select packages by capabilities.-l,--auto-agree-with-licensesโ automatically says yes to that third party license confirmation prompt. By using this option you're choosing to agree with the licenses of all third-party software this command will install. It's especially iconic for admins installing the same set of packages on a bunch of machines (via an automated process) who already had the licenses confirmed beforehand. Slay, no clicking. ๐ซถ--auto-agree-with-product-licensesโ automatically accepts product licenses only. Tools likeSUSEconnectuse this, since they ask for confirmation before the product gets registered. So there's no need to confirm the product license all over again at install time. Efficiency. โจ--replacefilesโ installs the packages even if they replace files from other, already installed, packages. The default is to treat file conflicts as an error. Heads up tho:--download-as-neededdisables the file conflict check, because the check needs access to all the packages' file lists in advance in order to actually run. ๐ญ-D,--dry-runโ test the installation, don't actually install anything. If you use it together with--download-onlyyou get a meaningful file conflict check (peep the Package File Conflicts section).--detailsโ shows the detailed installation summary. For the girlies who need the full receipts.-y,--no-confirmโ don't require user interaction. Lowkey the recommendation is to use the--non-interactiveglobal option instead โ global options get passed before the command (zypper --non-interactive COMMAND ...). And unlike theno-confirmcommand option, the global option works with literally anyzyppercommand. Iconic behavior. ๐--allow-unsigned-rpmโ silently installs unsigned.rpmpackages given as commandline parameters. Ngl this option does not affect unsigned packages provided by repositories. If you want to let a repository provide unsigned packages without explicit confirmation, set that repository's--gpgcheck-allow-unsigned-packageoption โ see theaddrepoandmodifyrepocommands for the details. ๐ฅ
๐ Solver related options
--debug-solverโ creates a solver test case for debugging. Use this if you think the dependencies were not solved correctly. When you use this option no packages will be installed or removed โ instead a solver test case gets written to/var/log/zypper.solverTestCase. You can pack that directory up and attach it to your bug report. Chef's kiss debugging. ๐--force-resolutionโ forces the solver to find a solution (even an aggressive one) rather than asking.
So like, in order to perform the requested job, the solver is allowed to violate any otherwise active policy. That includes the allowance to remove packages, but also not respecting even explicitly set policies (by --no-allow-policy or in config files). It is not recommended to use this option in unattended environments. You've been warned bestie ๐
Also: the allowance to remove dependent packages is the default when removing packages (zypper remove).
-R,--no-force-resolutionโ do not force the solver to find a solution. Instead it reports dependency problems and prompts the user to resolve them manually. This is the default โ except when removing packages (zypper remove).--solver-focusMODE โ sets the solver's general attitude when resolving a job. Valid modes areJob,InstalledorUpdate. See the Package Dependencies section for the details. It's giving main character energy for the solver.--recommendsโ installs recommended packages too, on top of the required ones. The default behavior is determined by[zypp.conf:solver.onlyRequires].--no-recommendsโ don't install recommended packages, only the required ones. The default behavior is determined by[zypp.conf:solver.onlyRequires]. (Yes, same config, we stay consistent.) ๐ธ
๐ Download-and-install mode options
-d,--download-onlyโ only downloads the packages for later installation (also peep the global--pkg-cache-diroption).
If used together with --dry-run you get a meaningful file conflict check (see the Package File Conflicts section).
--download-in-advanceโ first downloads all packages, then starts installing. This is the default.--download-in-heapsโ downloads a minimal set of packages that can be installed without leaving the system in a broken state, and installs them. Then it downloads and installs another heap until all of them are installed. This helps keep the system in a consistent state without needing to download everything in advance โ which combines the advantages of--download-in-advanceand--download-as-needed.
Note โ while the resolver is not capable of building heaps, this behaves the same as --download-in-advance. ๐ฆ
--download-as-neededโ download one package, install it immediately, and continue with the rest until all of them are installed. Snack-sized. ๐--downloadmode โ use the specified download-and-install mode. Available modes are:only,in-advance,in-heaps,as-needed. See the corresponding--download-modeoptions for their description.
โญ Expert Options
Don't use them unless you know you need them. Fr fr, this is not the place to vibe check your curiosity. ๐
--allow-downgrade,--no-allow-downgradeโ whether to allow downgrading installed resolvables.--allow-name-change,--no-allow-name-changeโ whether to allow changing the names of installed resolvables. Setting this tonowill not replace packages which have been renamed.--allow-arch-change,--no-allow-arch-changeโ whether to allow changing the architecture of installed resolvables.--allow-vendor-change,--no-allow-vendor-changeโ whether to allow changing the vendor of installed resolvables. Setting this tonomight be useful if you don't want packages from foreign repos being changed to the distribution's version (or vice versa). ๐
๐ Examples
$ zypper install -t pattern lamp_server
Install lamp_server pattern.
$ zypper install --no-recommends gv
Install GhostScript viewer, but ignore recommended packages.
$ zypper install virtualbox-ose-2.0.6
$ zypper install virtualbox-ose=2.0.6
$ zypper install virtualbox-ose = 2.0.6
Install version 2.0.6 of virtualbox-ose package.
Like, look at all those ways to say the exact same version. Versatility queen. ๐
๐ง source-install (si) name...
Installs the specified source packages and their build dependencies. And plot twist: if you give it the name of a binary package, the corresponding source package gets looked up and installed instead. We love a translation moment. โจ
This command will try to find the newest available versions of the source packages and uses rpm -i to install them, optionally together with all the packages that are required to build the source package. The default location where rpm installs source packages to is /usr/src/packages/{SPECS,SOURCES}, but the values can be changed in your local rpm configuration. In case of doubt, try executing rpm --eval "%{_specdir} and %{_sourcedir}".
Ngl, the source packages must be available in repositories you are using. You can check whether a repository contains any source packages using this command:
$ zypper search -t srcpackage -r alias|name|#|URI
$ zypper search -t srcpackage -r alias|name|#|URI
-d,--build-deps-onlyโ install only the build dependencies of the specified packages.-D,--no-build-depsโ don't install build dependencies. Periodt.-r,--repoalias|name|#|URI โ work only with the repository specified by the alias, name, number, or URI. This option can be used multiple times. ๐ซถ--download-onlyโ only download the packages, don't install. Saving them for later, we respect the hustle.
๐ Examples
$ zypper si -d dbus-1
Install build dependencies of dbus-1 source package.
๐ฆ verify (ve) [options]
Checks whether the dependencies of installed packages are satisfied. Basically a wellness check for your system. ๐ฉบ
In case any dependency problems are found, zypper suggests packages to install or remove to fix them. It's giving helpful bestie energy.
-D,--dry-runโ test the repair, don't actually do anything to the system. If used together with--download-onlya meaningful file conflict check can be performed (see the Package File Conflicts section).--detailsโ show the detailed installation summary.-r,--repoalias|name|#|URI โ work only with the repository specified by the alias, name, number, or URI. This option can be used multiple times.-y,--no-confirmโ don't require user interaction. It's recommended to use the--non-interactiveglobal option instead. Global options are passed before the command (zypper --non-interactive COMMAND ...). Unlike theno-confirmcommand option, the global option can be used together with anyzyppercommand. ๐
๐ธ Solver related options
--debug-solverโ create a solver test case for debugging. Use this option if you think the dependencies were not solved correctly. When using this option no packages will be installed or removed. Instead a solver test case is written to/var/log/zypper.solverTestCase. You can pack the directory and attach it to your bug report.--force-resolutionโ force the solver to find a solution (even an aggressive one) rather than asking.
In order to perform the requested job the solver is allowed to violate any otherwise active policy. This includes the allowance to remove packages but also not to respect even explicitly set policies (by --no-allow-policy or in config files). It is not recommended to use this option in unattended environments. ๐ญ
๐ okay picking up mid-thought, because we were literally in the middle of the --force-resolution glow-up:
The allowance to remove dependent packages is the default when removing packages (zypper remove).
-R,--no-force-resolutionโ do not force the solver into finding a solution. Instead it reports the dependency problems and prompts you to sort them out manually. This is the default โ except when you're removing packages (zypper remove), where forcing is the default instead.--solver-focus MODEโ sets the solver's general attitude when it's resolving a job. The valid modes areJob,InstalledorUpdate. Head to the Package Dependencies section for the details, bestie.--recommendsโ install the recommended packages too, on top of the required ones. The default behavior here is decided by[zypp.conf:solver.onlyRequires].--no-recommendsโ skip the recommended packages, install only the required ones. Again, default behavior is decided by[zypp.conf:solver.onlyRequires].
โจ Expert Options โจ
๐ Do not touch these unless you know you need them. Like, genuinely know. Not "I saw it on a forum" know.
--allow-downgrade,--no-allow-downgradeโ whether it's allowed to downgrade installed resolvables.--allow-name-change,--no-allow-name-changeโ whether it's allowed to change the names of installed resolvables. Setting this to no means packages that got renamed will not be replaced.--allow-arch-change,--no-allow-arch-changeโ whether it's allowed to change the architecture of installed resolvables.--allow-vendor-change,--no-allow-vendor-changeโ whether it's allowed to change the vendor of installed resolvables. Setting this to no might be useful if you do not want packages from foreign repos being changed to the distribution's version (or vice versa) ๐ซถ.
This command also accepts the Download-and-install mode options described in the install command.
๐ง install-new-recommends (inr) [options]
Install newly added packages that are recommended by stuff you already have installed. Basically it re-evaluates the recommendations of all your installed packages and fills the system up accordingly. Lowkey important: you do not want to call this unconditionally on small or minimal systems โ it can easily add a large number of packages ๐ญ.
Called as zypper inr --no-recommends, it restricts itself to just looking for packages that support available hardware, languages or filesystems. Super useful after you've added, like, new hardware or driver repos. This is also the default behavior if you have set [zypp.conf:solver.onlyRequires].
-r,--repo alias|name|#|URIโ work only with the repository specified by the alias, name, number, or URI. This option can be used multiple times ๐.-D,--dry-runโ test the installation, don't actually install anything. If you use it together with--download-only, a meaningful file conflict check can be performed (see the Package File Conflicts section).--detailsโ show the detailed installation summary.
Solver related options:
--debug-solverโ create a solver test case for debugging. Use this if you think the dependencies were not solved correctly. When using this option no packages will be installed or removed โ instead a solver test case is written to/var/log/zypper.solverTestCase. You can pack that directory up and attach it to your bug report ๐.--force-resolutionโ force the solver to find a solution (even an aggressive one) rather than asking.
So that it can perform the requested job, the solver is allowed to violate any otherwise active policy. This includes the allowance to remove packages, but also not respecting even explicitly set policies (by --no-allow-policy or in config files). It is not recommended to use this option in unattended environments โ ๏ธ.
The allowance to remove dependent packages is the default when removing packages (zypper remove).
-R,--no-force-resolutionโ do not force the solver to find a solution. Instead, report dependency problems and prompt the user to resolve them manually. This is the default except when removing packages (zypper remove).--solver-focus MODEโ set the solver's general attitude when resolving a job. Valid modes areJob,InstalledorUpdate. See the Package Dependencies section for details.--recommendsโ install also recommended packages in addition to the required ones. The default behavior is determined by[zypp.conf:solver.onlyRequires].--no-recommendsโ do not install recommended packages, but only required ones. The default behavior is determined by[zypp.conf:solver.onlyRequires].
Expert Options:
๐ Don't use them unless you know you need them. (Yes, again. It's that serious.)
--allow-downgrade,--no-allow-downgradeโ whether to allow downgrading installed resolvables.--allow-name-change,--no-allow-name-changeโ whether to allow changing the names of installed resolvables. Setting this to no will not replace packages which have been renamed.--allow-arch-change,--no-allow-arch-changeโ whether to allow changing the architecture of installed resolvables.--allow-vendor-change,--no-allow-vendor-changeโ whether to allow changing the vendor of installed resolvables. Setting this to no might be useful if you do not want packages from foreign repos being changed to the distribution's version (or vice versa).
This command also accepts the Download-and-install mode options described in the install command.
๐๏ธ remove (rm) [options] name...
๐๏ธ remove (rm) [options] --capability capability...
Remove (uninstall) packages. Bye bestie ๐
The remove command will uninstall the selected packages and their dependent packages. It will not try to install alternatives in order to keep dependent packages installed. If you want that behavior, use zypper install !name.
The packages can be selected by their name or by a capability they provide. For the details on package selection, see the install command description.
-r,--repo alias|name|#|URIโ work only with the repository specified by the alias, name, number, or URI. This option can be used multiple times.-t,--type typeโ type of package (default:package). See the Package Types section for the list of available package types.
Ngl, this one has lore: since patches are not installed in the 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. That's just how it is ๐ .
-n,--nameโ select packages by their name (default).-C,--capabilityโ select packages by capabilities.-D,--dry-runโ test the removal of packages, don't actually remove anything.--detailsโ show the detailed installation summary.-y,--no-confirmโ don't require user interaction. It's recommended to use the--non-interactiveglobal option instead. Global options are passed before the command (zypper --non-interactive COMMAND ...). Unlike theno-confirmcommand option, the global option can be used together with any zypper command ๐
Solver related options:
--debug-solverโ create a solver test case for debugging. Use this option if you think the dependencies were not solved correctly. When using this option no packages will be installed or removed. Instead a solver test case is written to/var/log/zypper.solverTestCase. You can pack the directory and attach it to your bug report.--force-resolutionโ force the solver to find a solution (even an aggressive one) rather than asking.
In order to perform the requested job the solver is allowed to violate any otherwise active policy. This includes the allowance to remove packages but also not to respect even explicitly set policies (by --no-allow-policy or in config files). It is not recommended to use this option in unattended environments.
The allowance to remove dependent packages is the default when removing packages (zypper remove).
-R,--no-force-resolutionโ do not force the solver to find a solution. Instead, report dependency problems and prompt the user to resolve them manually. This is the default except when removing packages (zypper remove).--solver-focus MODEโ set the solver's general attitude when resolving a job. Valid modes areJob,InstalledorUpdate. See the Package Dependencies section for details.-u,--clean-depsโ automatically remove dependencies which become unneeded after removal of the requested packages โจ.-U,--no-clean-depsโ no automatic removal of unneeded dependencies.
๐ธ removeptf (rmptf) [options] <PTF|CAPABILITY> ...
Remove (not only) PTFs.
A remove command which prefers replacing dependent packages to removing them as well. In fact this is a full featured install command with the remove modifier (-) applied to its plain arguments. So removeptf foo is the same as install โ -foo. This is why the command accepts the same options as the install command. It is the recommended way to remove a PTF (Program Temporary Fix) ๐.
A PTF is typically removed as soon as the fix it provides is applied to the latest official update of the dependent packages. But you don't want the dependent packages to be removed together with the PTF, which is exactly what the remove command would do ๐ญ. The removeptf command, however, will aim to replace the dependent packages by their official update versions.
supports every option the install command supports.
๐ฆ purge-kernels [options]
Autoremoves installed kernels. Yes, it just does that on its own, main character energy.
Automatically cleans up installed kernels according to the rules defined in [zypp.conf:multiversion.kernels], which can be given as <version>, latest[-N], running, oldest[+N].
--detailsโ show the detailed installation summary.-D,--dry-runโ test the removal of packages, do not actually remove anything.
โญ Update Management Commands
๐ list-updates (lu) [options]
List available updates. That's it, that's the whole vibe โ but it's such a useful one.
okay so real talk, this command is only gonna show you the updates you can actually install โ like, the ones with zero dependency drama, or the ones that don't try to switch up your package vendor on you. This is literally the exact list update will be like "bestie, may I?" about. Want the full chaos list of every package with a newer version out there? That's what the --all option is for, iykyk.
-t,--typetype โ what kind of package we're talking about (default:package). Peep the Package Types section for the whole menu of types.
oh and if you saypatchhere, zypper's just gonna act like you ran thelist-patchescommand instead. plot twist ๐
-r,--repoalias|name|#|URI โ only mess with the repo you point at, by alias, name, number, or URI. Yes you can stack this option multiple times. a queen can multitask ๐ซถ-a,--allโ show me every package that has a newer version available, whether it's installable or not. no filtering, no judgment.--best-effortโ the description lives over in theupdatecommand, go peek there โจ--filter-version-changeLEVEL โ filters updates by how significant the version change is, so your screen isn't just noise. LEVEL can be one of:noneโ show literally all the updates. this is the default, no notes.rebuildโ hides updates where only the rebuild counter changed (that's the last dot-segment of the release string). the packaging checkin and upstream version are identical in those, so it's giving fake update energy.packageโ hides updates where only the release changed (checkin and/or rebuild), meaning the upstream version is identical. this one's more aggressive thanrebuild.
heads up bestie: Epoch changes are never filtered. And this option does not apply to patches โ for those you use list-patches filtering instead. don't come for me, that's just how it is.
๐ Expert Options
Don't use them unless you know you need them. like genuinely. they're the "I know what I'm doing" section.
--allow-downgrade,--no-allow-downgradeโ whether we're allowed to downgrade installed resolvables or not. pick your fighter.--allow-name-change,--no-allow-name-changeโ whether installed resolvables are allowed to change names. set this to no and packages that got renamed just won't get replaced. simple as.--allow-arch-change,--no-allow-arch-changeโ whether installed resolvables can switch architecture.--allow-vendor-change,--no-allow-vendor-changeโ whether installed resolvables can switch vendor. setting this to no is lowkey useful if you don't want packages from foreign repos getting swapped over to the distro's version (or the other way around). ๐
๐ update (up) [options] [packagename]...
Updates your installed packages to newer versions where it's possible. Slay.
but listen โ this command is not gonna update packages that would need a vendor change (unless that vendor is listed in /etc/zypp/vendors.d), and it's not gonna touch stuff that needs you to manually sort out dependency problems. those non-installable updates get listed in their own special section of the summary, and it literally says:
The following package updates will NOT be installed:
sad but honest ๐ญ
Wanna update just a couple individual packages? Name them, one or more, no problem. And yes, you can use the * and ? wildcard characters in package names to catch multiple packages matching a pattern. sparkle โจ
-t,--typetype โ type of package (default:package). Check the Package Types section for the full lineup.
and psst โ if you passpatchhere, zypper acts exactly like you ran thepatchescommand. same energy.
-r,--repoalias|name|#|URI โ work only with the repo given by alias, name, number, or URI. this one's stackable too, use it multiple times ๐--skip-interactiveโ skips the interactive patches. you know, the ones that need a reboot, carry a message, or update a package whose license needs confirming. bye felicia--with-interactiveโ avoids skipping interactive patches when you're in non-interactive mode. opposite day, but make it useful.-l,--auto-agree-with-licensesโ automatically says yes to the third-party license confirmation prompt. by using this you're choosing to agree with the licenses of all third-party software the command installs. super handy for admins pushing the same set of packages across a bunch of machines via an automated process โ get those licenses confirmed upfront ๐--auto-agree-with-product-licensesโ automatically accepts product licenses only. this is what tools likeSUSEconnectuse, since they ask for confirmation before the product gets registered. so no, you don't gotta confirm the product license all over again at install time ๐--replacefilesโ install the packages even if they replace files from other packages that are already installed. default behavior is to treat file conflicts as an error, so this is the "I said what I said" flag. careful:--download-as-neededdisables the fileconflict check, because the check needs access to all the packages' filelists upfront in order to, y'know, actually check.-D,--dry-runโ test the update, don't actually install or update anything. if you pair it with--download-only, you get a meaningful file conflict check (see the Package File Conflicts section). it's giving rehearsal ๐ญ--detailsโ show the detailed installation summary. for the girls who read the receipts.--best-effortโ best effort approach to updating. here's the tea: this doesn't explicitly select packages with the best version and architecture. instead it requests installation of a package with a higher version than the installed one and justโฆ leaves the rest to the dependency solver. this method is always used for packages, optional for products and patterns, and not applicable to patches. periodt.-y,--no-confirmโ don't require user interaction. but ngl, the recommendation is to use the--non-interactiveglobal option instead. global options go before the command (zypper --non-interactive COMMAND ...), and unlike theno-confirmcommand option, the global one works with literally any zypper command. glow up ๐
๐ง Solver related options
--debug-solverโ creates a solver test case for debugging. use it when you think the dependencies got solved wrong. with this option no packages will be installed or removed โ instead a solver test case gets written to/var/log/zypper.solverTestCase. pack that directory up and attach it to your bug report, king ๐ซถ--force-resolutionโ forces the solver to find a solution, even an aggressive one, instead of asking.
so in order to do the requested job, the solver is allowed to violate any otherwise active policy. that includes being allowed to remove packages, and also not respecting even explicitly set policies (set via --no-allow-policy or in config files). it is not recommended to use this option in unattended environments. like, fr.
also fyi: the allowance to remove dependent packages is the default when removing packages (zypper remove).
-R,--no-force-resolutionโ don't force the solver to find a solution. instead it reports dependency problems and prompts the user to resolve them manually. this is the default except when removing packages (zypper remove). calm vibes.--solver-focusMODE โ sets the solver's general attitude when resolving a job. valid modes areJob,Installed, orUpdate. see the Package Dependencies section for the details. main character energy for your solver ๐--recommendsโ installs recommended packages on top of the required ones. the default behavior is determined by[zypp.conf:solver.onlyRequires].--no-recommendsโ don't install recommended packages, only the required ones. default behavior again comes from[zypp.conf:solver.onlyRequires].
๐ Expert Options
Don't use them unless you know you need them. (yes I'm saying it again, it's important)
--allow-downgrade,--no-allow-downgradeโ whether downgrading installed resolvables is allowed.--allow-name-change,--no-allow-name-changeโ whether installed resolvables can change names. set it to no and renamed packages won't get replaced.--allow-arch-change,--no-allow-arch-changeโ whether installed resolvables can change architecture.--allow-vendor-change,--no-allow-vendor-changeโ whether installed resolvables can change vendor. setting this to no is useful when you don't want foreign-repo packages getting swapped to the distro's version (or vice versa). ๐ฆ
oh and one more thing โ this command also accepts the Download-and-install mode options described in the install command description. iykyk ๐
๐ list-patches (lp) [options]
Lists all applicable patches. basically this command is the same vibe as zypper list-updates -t patch.
important: note that optional arguments of some of the options below must be specified using = instead of a space. yes, the syntax is picky. she's worth it.
-b,--bugzilla[=#[,...]]โ list applicable patches for all Bugzilla issues, or for issues whose number matches the given string.--cve[=#[,...]]โ list applicable patches for all CVE issues, or issues whose number matches the given string.--dateYYYY-MM-DD[,...]โ list only patches issued up to, but not including, the specified date. sneaky little boundary ๐-g,--categorycategory[,...]โ list only patches with this category. see the Package Types section for a list of commonly used category values.--severityseverity[,...]โ list only patches with this severity. the Package Types section has the commonly used severity values.--issue[=string[,...]]โ look for issues whose number, summary, or description matches the specified string. issues found by number are displayed separately from the ones found by descriptions โ in that latter case, usezypper patch-info patchnameto get the info on which issues the patch fixes. detective mode ๐-a,--allโ by default only patches applicable to your system are listed. this option makes all available released patches show up instead. and yes, you can combine it with all the rest of thelist-updatescommand options. go off ๐--with-optional,--without-optionalโ whether applicable optional patches should be treated as needed or excluded. the default is to exclude optional patches. no โจ-r,--repoalias|name|#|URI โ okay so this one locks the whole operation to only the repo you point at with an alias, name, number, or URI. You can drop this option multiple times if youโre feeling extra ๐ .
๐ฉน patch-check (pchk) ๐ฉน
Check for patches. It shows you a count of applicable patches and how many of them are in the security category. Very โlet me see whatโs waiting for meโ energy.
See also the EXIT CODES section for details on exit status of 0, 100, and 101 returned by this command.
--updatestack-onlyโ only check for patches that affect the package management itself. Just the update-stack ones, bestie.--with-optional,--without-optionalโ whether applicable optional patches should be treated as needed or be excluded. The default is to exclude optional patches. So optional patches are lowkey not invited by default.-r,--repoalias|name|#|URI โ check for patches only in the repository specified by the alias, name, number, or URI. This option can be used multiple times. Multiple repos? Multiple-rflags. Slay.
๐ฉน patch [options] ๐ฉน
Install all available needed patches. This is the patch main-character moment.
When updating the affected/vulnerable packages described by a patch, zypper always aims for the latest available version. See section Package Types for more details about how patches operate.
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.
--updatestack-onlyโ install only patches which affect the package management itself and exit. In and out, update-stack business only.--skip-not-applicable-patchesโ skip needed patches which do not apply without conflict. In normal operation mode those conflicts have to be resolved interactively, otherwise thepatchcommand fails.
In scripted and unattended environments it may be desired to try to apply at least as many patches as possible so the system is not left completely without updates. It is highly recommended to run zypper patch-check afterwards in order to see whether needed patches are still waiting to be resolved interactively.
--with-updateโ additionally try to update all packages not covered by patches. This is basically the same as runningzypper updateafterwards. The option is ignored if thepatchcommand must update the update stack first, thus it can not be combined with the--updatestack-onlyoption. So yeah, donโt try to combo those two.--with-optional,--without-optionalโ whether applicable optional patches should be treated as needed or be excluded. The default is to exclude optional patches. Optional patches stay on read unless you say otherwise.-b,--bugzilla#[,...] โ select applicable patches for a Bugzilla issue specified by number. Uselist-patches --bugzillacommand to get a list of applicable patches for specific issues. Bugzilla besties, this oneโs for you.--cve#[,...] โ select applicable patches for a MITREโs CVE issue specified by number. Uselist-patches --cvecommand to get a list of applicable patches for specific issues. CVE mode: activated.--dateYYYY-MM-DD[,...] โ select only patches issued up to, but not including, the specified date. Time-travel-ish, but only backwards and only up to the date.-g,--categorycategory[,...] โ select only patches with this category. Uselist-patches --categorycommand to get a list of available patches with a specific category. See section Package Types for a list of commonly used category values. Category girlies, assemble.--severityseverity[,...] โ select only patches with this severity. Uselist-patches --severitycommand to get a list of available patches with a specific severity. See section Package Types for a list of commonly used severity values. Severity filter? Very discerning of you.-r,--repoalias|name|#|URI โ work only with the repository specified by the alias, name, number, or URI. This option can be used multiple times. Again: multiple repos, multiple flags, no cap.--skip-interactiveโ this will skip interactive patches, that is, those that need reboot, contain a message, or update a package whose license needs to be confirmed. No pop-ups, no pauses, no drama.--with-interactiveโ avoid skipping of interactive patches when in non-interactive mode. So interactive patches still get their moment even in non-interactive mode.-l,--auto-agree-with-licensesโ automatically say yes to third party license confirmation prompt. By using this option, you choose to agree with licenses of all third-party software this command will install. This option is particularly useful for administrators installing the same set of packages on multiple machines (by an automated process) and have the licenses confirmed before. Auto-yes for the license prompts, bestie.--auto-agree-with-product-licensesโ automatically accept product licenses only. This is used by tools likeSUSEconnect, which ask for confirmation before the product gets registered. So thereโs no need to confirm the product license again at install time. Product licenses only โ not the whole third-party buffet.--replacefilesโ install the packages even if they replace files from other, already installed, packages. Default is to treat file conflicts as an error.--download-as-neededdisables the fileconflict check because access to all packages filelists is needed in advance in order to perform the check. File conflicts are normally a hard no; this flag says โactually, replace them.โ-D,--dry-runโ test the update, do not actually update. If used together with--download-onlya meaningful file conflict check can be performed (see section Package File Conflicts). Test the vibe, donโt commit to the vibe.--detailsโ show the detailed installation summary. Give me the whole rundown, pls.-y,--no-confirmโ donโt require user interaction. Itโs recommended to use the--non-interactiveglobal option instead. Global options are passed before the command (zypper --non-interactive COMMAND ...). Unlike the no-confirm command option, the global option can be used together with anyzyppercommand. Global option > command option here, iykyk.
๐ง Solver related options
--debug-solverโ create solver test case for debugging. Use this option if you think the dependencies were not solved correctly. When using this option no packages will be installed or removed. Instead a solver test case is written to/var/log/zypper.solverTestCase. You can pack the directory and attach it to your bug report. No installs, just evidence for the bug report.--force-resolutionโ force the solver to find a solution (even an aggressive one) rather than asking.
In order to perform the requested job the solver is allowed to violate any otherwise active policy. This includes the allowance to remove packages but also not to respect even explicitly set policies (by --no-allow-policy or in config files). It is not recommended to use this option in unattended environments.
The allowance to remove dependent packages is the default when removing packages (zypper remove). Aggressive solver mode: handle with care, bestie.
-R,--no-force-resolutionโ do not force the solver to find a solution. Instead, report dependency problems and prompt the user to resolve them manually. This is the default except when removing packages (zypper remove). Ask first, solve together.--solver-focusMODE โ set the solverโs general attitude when resolving a job. Valid modes areJob,InstalledorUpdate. See section Package Dependencies for details. Solver attitude check: choose your mode.--recommendsโ install also recommended packages in addition to the required ones. The default behavior is determined by[zypp.conf:solver.onlyRequires]. Recommended packages get to come too.--no-recommendsโ do not install recommended packages, but only required ones. The default behavior is determined by[zypp.conf:solver.onlyRequires]. Required only. No extras.
๐งช Expert Options
Donโt use them unless you know you need them.
--allow-downgrade,--no-allow-downgradeโ whether to allow downgrading installed resolvables. Downgrade permission: yes or no.--allow-name-change,--no-allow-name-changeโ whether to allow changing the names of installed resolvables. Setting this to no will not replace packages which have been renamed. Package renames are not automatically invited.--allow-arch-change,--no-allow-arch-changeโ whether to allow changing the architecture of installed resolvables. Architecture glow-up? Only if you say so.--allow-vendor-change,--no-allow-vendor-changeโ whether to allow changing the vendor of installed resolvables. Setting this to no might be useful if you do not want packages from foreign repos being changed to the distributionโs version (or vice versa). Vendor loyalty settings, basically.
This command also accepts the Download-and-install mode options described in the install command description.
๐ dist-upgrade (dup) [options] ๐
Perform a distribution upgrade. This command applies the state of (specified) repositories onto the system; upgrades (or even downgrades) installed packages to versions found in repositories, removes packages that are no longer in the repositories and pose a dependency problem for the upgrade, handles package splits and renames, etc. Itโs giving โwhole system era change.โ
If no repositories are specified via the --from option, zypper will do a global upgrade with all defined repositories. This global form of dup will also consider unchanged installed packages and re-evaluate their dependencies. 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. Messy repo overlap? Not the vibe.
For all repositories which have the distribution version within their URL (like https://download.opensuse.org/distribution/13.1/repo/oss) using the $releasever variable instead may be helpful (https://download.opensuse.org/distribution/$releasever/repo/oss). The variable is per default substituted by the current distributionโs version (13.1). One URL pattern to rule them all.
This value can be temporarily overwritten in the current zypper command by using the --releasever global option. Calling zypper --releasever 13.2... will cause these repos to use the new location (https://download.opensuse.org/distribution/13.2/repo/oss) without the need to add/remove anything. But youโll need to use --releasever 13.2 with every zypper command until the distribution upgrade was actually performed. Once the dup is done, $releasever will default to the new distribution version 13.2 and --releasever is no longer needed. So yes, you have to keep passing --releasever 13.2 until the dup actually happens. Then it can retire, periodt.
...it might be way less tedious to just persistently set $releasever to the target distribution value so you don't need --releasever at all. Peep the Repository Management section for the whole variable substitution situation and how to define custom variables. ๐ซถ
Note: doing a distribution upgrade auto-creates a solver test case at /var/log/updateTestcase-YYYY-MM-DD-hh-mm-ss (that's the date and time the command ran, bestie).
Note: openSUSE distribution upgrades are currently only supported between consecutive releases. Wanna jump multiple releases? You upgrade each consecutive release one at a time, no skipping, no shortcuts. More deets athttp://en.opensuse.org/SDB:System_upgradeand the openSUSE release notes athttp://doc.opensuse.org/release-notes/. ๐
Note: because of how orphaned packages are handled, dist-upgrade depends on a proper repository setup more than literally any other command. It must not continue if enabled repos fail to refresh โ that can severely damage the system. Like, catastrophic main character villain arc energy. If a failing repo isn't actually needed, it must be disabled. Periodt.
--fromalias|name|#|URI โ you can use this option multiple times, and it restricts the upgrade to only the repos you specified. That said, all enabled repositories are still visible to the resolver and will be considered to satisfy dependency problems. iykyk.--remove-orphanedโ removes orphaned packages. Installed packages that aren't provided by at least one of the available repositories count as orphaned or dropped.dist-upgraderemoves orphaned packages if they prevent the upgrade of wanted packages; with this option, all unneeded orphaned packages get yeeted.
Note: packages that aren't shipped within a repository โ the manually built or downloaded ones โ can be collected in a plaindir repository so they don't get treated as orphaned. See the section System Packages for the tea. ๐
-r,--repoalias|name|#|URI โ work only with the repository specified by the alias, name, number, or URI.
Using --repo is discouraged ngl, because it currently hides unmentioned repositories from the resolver, which leads to inexpertly decisions ๐ญ. Why? Because packages originally installed from the hidden repos now get treated as orphaned or dropped, and they can be silently removed if they're involved in a dependency conflict. In the future --repo will become an alias for --from.
-l,--auto-agree-with-licensesโ auto-says yes to the third party license confirmation prompt. By using this option you choose to agree with the licenses of all third-party software this command will install. Super useful for admins installing the same set of packages on multiple machines (via an automated process) who've already confirmed the licenses beforehand. ๐--auto-agree-with-product-licensesโ automatically accepts product licenses only. Tools like SUSEconnect use this, since they ask for confirmation before the product gets registered โ so there's no need to confirm the product license again at install time. Slay.--replacefilesโ install the packages even if they replace files from other, already installed, packages. Default is to treat file conflicts as an error. Heads up:--download-as-neededdisables the fileconflict check, because access to all packages' filelists is needed in advance in order to perform the check.-D,--dry-runโ test the upgrade, don't actually install or update any package. If you use it together with--download-only, a meaningful file conflict check can be performed (see section Package File Conflicts). โจ-y,--no-confirmโ don't require user interaction. It's recommended to use the--non-interactiveglobal option instead, though. Global options are passed before the command, likezypper --non-interactive COMMAND ..., and unlike the no-confirm command option, the global option can be used together with any zypper command. ๐ซถ--detailsโ show the detailed installation summary.
๐ง Solver related options ๐ง
--debug-solverโ creates a solver test case for debugging. Use this if you think the dependencies were not solved correctly. When you use this option, no packages will be installed or removed โ instead a solver test case is written to/var/log/zypper.solverTestCase. You can pack the directory and attach it to your bug report. ๐--force-resolutionโ forces the solver to find a solution (even an aggressive one) rather than asking.
In order to perform the requested job, the solver is allowed to violate any otherwise active policy. This includes the allowance to remove packages, but also not respecting even explicitly set policies (by --no-allow-policy or in config files). It is not recommended to use this option in unattended environments. ๐
The allowance to remove dependent packages is the default when removing packages (zypper remove).
-R,--no-force-resolutionโ don't force the solver to find a solution. Instead, report dependency problems and prompt the user to resolve them manually. This is the default, except when removing packages (zypper remove).--solver-focusMODE โ sets the solver's general attitude when resolving a job. Valid modes areJob,InstalledorUpdate. See section Package Dependencies for details.--recommendsโ install also recommended packages in addition to the required ones. The default behavior is determined by[zypp.conf:solver.onlyRequires].--no-recommendsโ do not install recommended packages, only required ones. The default behavior is determined by[zypp.conf:solver.onlyRequires].
๐ Expert Options ๐
Don't use them unless you know you need them. Fr fr.
--allow-downgrade,--no-allow-downgradeโ whether to allow downgrading installed resolvables.--allow-name-change,--no-allow-name-changeโ whether to allow changing the names of installed resolvables. Setting this to no will not replace packages which have been renamed.--allow-arch-change,--no-allow-arch-changeโ whether to allow changing the architecture of installed resolvables.--allow-vendor-change,--no-allow-vendor-changeโ whether to allow changing the vendor of installed resolvables. Setting this to no might be useful if you don't want packages from foreign repos being changed to the distribution's version (or vice versa).
This command also accepts the Download-and-install mode options described in the install command description. ๐
Examples:
$ zypper dup --from factory --from packman
Upgrade the system to the latest versions provided by the
factory and packman repositories.
Upgrade the system to the latest versions provided by the factory and packman repositories. Iconic. ๐ฅ
๐ธ Query Commands ๐ธ
search (se) [options] [querystring|capability]...
Search for packages matching any of the given search strings! * and ? wildcard characters can be used within search strings. And if the search string is enclosed in / (e.g. /^k.*e$/), it's interpreted as a regular expression. See the install command for details about how to specify a capability. โจ
If the search string starts with a /, a filename is assumed and the search will automatically look into the file list of packages. Otherwise use -f to search in the packages' file lists as well.
Results of the search are printed in a table with columns Status, Name, Summary and Type of package. In case the query result is empty, zypper returns ZYPPER_EXIT_INF_CAP_NOT_FOUND, unless the --ignore-unknown global option is set.
In the detailed view (se -s) all available instances of matching packages are shown; each version in each repository on a separate line, with columns Status, Name, Type, Version, Architecture and Repository. For installed packages, Repository shows either a repository that provides exactly the installed version of the package, or โ if the exact version is not provided by any known repo โ (System Packages) (or @System). Those installed packages not provided by any repo are often denoted as being unwanted, orphaned or dropped. ๐ญ
The Status column can contain the following values:
i+โ installed by user requestiโ installed automatically (by the resolver, see section Automatically installed packages)vโ a different version is installed- empty โ neither of the above cases
!โ a patch in needed state.lโ is shown in the 2nd column if the item is locked (see section Package Locks Management).Pโ is shown in the 2nd column if the item is part of a PTF (A program temporary fix which must be explicitly selected and will otherwise not be considered in dependency resolution)..Rโ is shown in the 2nd column if the item has been retracted (see patch in section Package Types)
The v status is only shown if the version or the repository matters (see --details or --repo), and the installed instance differs from the one listed in version or repository. ๐
The verbose view (se -v; implies -s) will also show the matches themselves within the package's metadata.
This command accepts the following options:
--match-substringsโ matches for search strings may be partial words (default).--match-wordsโ matches for search strings may only be whole words.-x,--match-exactโ searches for an exact name of the package.--providesโ search for packages which provide the search strings.--requiresโ search for packages which require the search strings.--recommendsโ search for packages which recommend the search strings.--suggestsโ search for packages which suggest the search strings.--conflictsโ search for packages conflicting with the search strings.--obsoletesโ search for packages which obsolete the search strings.--supplementsโ search for packages which supplement the search strings.--enhancesโ search for packages which enhances the search strings.--provides-pkgโ search for all packages that provide any of the provides of the package(s) matched by the input parameters.--requires-pkgโ search for all packages that require any of the provides of the package(s) matched by the input parameters.--recommends-pkgโ hunts down every package that recommends any of the provides of the package(s) your input matched โจ--supplements-pkgโ finds all the packages that supplement any of the provides of the package(s) you matched ๐--conflicts-pkgโ pulls up every package that conflicts with any of the package(s) matched by your input ๐ญ--obsoletes-pkgโ shows all packages that obsolete any of the package(s) matched by your input ๐--suggests-pkgโ finds every package that suggests any of the provides of the package(s) matched by your input ๐ซถ--enhances-pkgโ finds all packages that enhance any of the provides of the package(s) matched by your input ๐ธ-n,--nameโ lowkey the "nice with dependency options" flag; other than that, searching in the package name is already the default ๐-f,--file-listโ search inside the file list of packages. Important caveat, bestie: the full file list is only available for installed packages. For remote packages you only get an abstract of their file list inside the metadata (the files containing/etc/,/bin/, or/sbin/). ๐-d,--search-descriptionsโ also searches inside summaries and descriptions ๐-C,--case-sensitiveโ makes the search case-sensitive, like a little diva ๐ฅ-i,--installed-onlyโ only shows the packages you actually have installed ๐-u,--not-installed-onlyโ only shows packages that are not installed.
the old option name --uninstalled-only still works, but it should be considered deprecated ๐ซ
-t,--typetype โ only search for packages of the specified type. Peep the Package Types section for the list of available types. You can stack multiple--typeoptions, no cap ๐
also check out the type-specific query commands likepackages,patterns, etc. โ they're giving convenience โจ
-r,--repoalias|name|#|URI โ work only with the repository given by the alias, name, number, or URI. You can use this option multiple times ๐--sort-by-nameโ sorts packages by name (this is the default, so it's the main character of sorting) โญ--sort-by-repoโ sorts packages by repository instead of by name ๐ฆ-s,--detailsโ shows all available versions of matching packages, each version in each repository on its own separate line ๐-v,--verboseโ like--detailsbut with extra info about where the search matched โ super useful when you're searching for dependencies, like with--provides๐
Examples, because yes:
$ zypper se 'yast*'
Search for YaST packages. Quote the string so the shell doesn't expand the wildcard for you ๐ฅ
$ zypper se -s --match-exact kernel-default
Show all available versions of package kernel-default โจ
$ zypper se -dC --match-words RSI
Look for the RSI acronym (case-sensitively, ty -C), also in summaries and descriptions ๐ง
๐ฆ packages (pa)
packages (pa) [options] [repository]...
Lists all available packages โ or all packages from the repositories you specified. Basically zypper search -s -t package but with its own command name ๐
-r,--repoalias|name|#|URI โ just another means to specify repositories ๐ธ-i,--installed-onlyโ show only installed packages ๐-u,--not-installed-onlyโ show only packages which are not installed.
the old option name --uninstalled-only is still acceptable, but should be considered deprecated ๐ซ
--autoinstalledโ show installed packages which were automatically selected by the resolver ๐ค--userinstalledโ show installed packages which were explicitly selected by the user ๐--systemโ show installed packages which are not provided by any repository ๐ซถ--orphanedโ show system packages which are orphaned (no repository and no update candidate). If you combine it with--system, the status of orphaned packages gets tagged with(o)๐ญ--suggestedโ show packages which are suggested โจ--recommendedโ show packages which are recommended ๐--unneededโ show packages which are unneeded ๐
๐ฉน patches (pch)
patches (pch) [options] [repository]...
Lists all available patches from the specified repositories, including the ones you don't even need. Short for zypper lp -a ๐
-r,--repoalias|name_|#|URI โ just another means to specify repositories ๐
ngl that name_ with the trailing underscore is literally what the man page says โ keeping it character for character, bestie ๐
๐งฉ patterns (pt)
patterns (pt) [options] [repository]...
Lists all available patterns, or all patterns from the repositories you named. Similar to zypper search -s -t pattern โจ
-r,--repoalias|name|#|URI โ just another means to specify repositories ๐ธ-i,--installed-onlyโ show only installed patterns ๐-u,--not-installed-onlyโ show only patterns which are not installed.
the old option name --uninstalled-only is still acceptable, but should be considered deprecated ๐ซ
๐ท๏ธ products (pd)
products (pd) [options] [repository]...
Lists all available products, or all products from the repositories you specified. Similar to zypper search -s -t product, but it also shows the type of the product (base, add-on) ๐
-r,--repoalias|name|#|URI โ just another means to specify repositories ๐ฆ-i,--installed-onlyโ show only installed products ๐-u,--not-installed-onlyโ show only products which are not installed.
the old option name --uninstalled-only is still acceptable, but should be considered deprecated ๐ซ
--xmlfwdtag โ XML output only, babes: it literally forwards the XML tag if that tag is found in an installed product's.prod-file(in/etc/products.d) ๐
Using this option, for each installed product an <xmlfwd> node gets created inside the <product> output node of the product.
tag defines the name (or /-separated path) of an xml-tag inside an installed product's .prod-file. If the tag is present inside the product's .prod-file, the tag and its content is literally forwarded into the product's <xmlfwd> output node ๐ฅ
The option may be specified multiple times ๐
Example:
$ zypper -x pd --xmlfwd name --xmlfwd register/target
๐ what-provides (wp) capability
Lists all packages providing the specified capability (case-insensitive search). Also peep the install command for info about specifying capabilities ๐
The command line is automatically transformed into the corresponding search command:
$ zypper what-provides 'zypper>1.6'
$ zypper search --provides --match-exact 'zypper>1.6'
For a case-sensitive search, call:
$ zypper search --provides --match-exact --case-sensitive 'zypper>1.6'
๐ธ Repository Management ๐ธ
Zypper is able to work with YaST, RPM-MD (yum) software repositories, and plain directories containing .rpm files (no symlinks, bestie โ no symlinks ๐ญ).
Repositories are primarily identified using their URI or alias. The alias serves as a shorthand for the long URI or name of the repository. The name of the repository should briefly describe it and is shown to the user in tables and messages. The name isn't required โ if it's not known, the alias is shown instead. The alias is required and uniquely identifies the repository on the system ๐
You can use the alias, name, URI, or the number from zypper repos list to specify a repository as an argument of various zypper commands and options, like refresh, --repo, or --from โจ
Beyond all that, repositories have several other properties which you can 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 variables inside a .repo or .service file's name and URI values ๐
$archโ refer to the system's CPU architecture ๐$basearchโ refer to the base architecture of the system. For example, iX86 machines have a base architecture ofi386, while AMD64 and Intel64 havex86_64๐$releasever,$releasever_major,$releasever_minorโ refer to the version of your openSUSE or SUSE Linux. The value is obtained from the/product/versionXML-node in/etc/products.d/baseproduct๐ฆ
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, iconic behaviour fr fr ๐ฅ
To help perform a distribution upgrade, the value of $releasever can be persistently set to a user-defined value by creating a custom variable with that name (see below). This way you can easily switch all repositories using $releasever over to the new version โ provided the server layouts did not change and new repos are already available ๐
For a single zypper command, the value of $releasever can be temporarily overwritten using the --releasever global option โจ
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 ๐
๐ Custom Variables
A custom repository variable is defined by creating a file in /etc/zypp/vars.d. The variable name equals the file name. The file's first line (up to but not including the newline character) defines the variable's value. Valid variable (file) names consist of alphanumeric chars and underscore only ๐ธ
This is how you can set a custom variable โ e.g. $releasever โ to a value of 99.0:
echo "99.0" >/etc/zypp/vars.d/releasever
To remove the custom variable, simply delete its file in /etc/zypp/vars.d:
rm /etc/zypp/vars.d/releasever
To check where you already use $releasever, call:
zypper --releasever @--HERE--@ lr -u
Remember to protect the $ when you use these variables on a shell command line:
zypper ar -f http://ftp.gwdg.de/pub/linux/packman/suse/\$releasever packman
If a variable is followed by an alphanumeric character or underscore, it needs to be enclosed in {}:
zypper ar -f http://ftp.gwdg.de/pub/linux/packman/suse/\${releasever}_packman
Bash-style definition of default ${variable:-word} and alternate ${variable:+word} values:
SLE-${releasever_major}${releasever_minor:+-SP-$releasever_minor}
NOTE: Variable substitution inside a URIโs authority is limited tohostandportonly. Bash-style definition of default and alternate values? not supported. And no variables can be used in a URIโsscheme,user, andpassword. periodt ๐
Supported URI formats: the whole URI menu ๐โจ
Hereโs the general shape, bestie:
scheme:@]host[:port]]/path[?query][#fragment]
Special characters in URI components (like a @ in a password) must be %-encoded (%40). iykyk ๐ฆ
CD or DVD drive ๐ฟ
Optionally with devices list for probing.
cd:///
dvd:/subdir?devices=/dev/sr0,/dev/sr1
FTP/HTTP/HTTPS directory tree ๐
The ftp URL scheme supports absolute and relative paths to the default ftp server directory (RFC1738, Section 3.2.2). To use an absolute path, you have to prepend the path with an additional slash, what results in a /%2f combination (second / encoded to %2f) at the begin of the URL path. This is important, especially in user authenticated ftp, where the users home is usually the default directory of the server (except when the server chroots into the users home directory).
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.
SSL verification behavior can be changed using the ssl_verify option (this should be used with care). Valid values are yes (the secure default), host, peer or no. Host just checks that the "Common Name" field or a "Subject Alternate Name" field in the servers certificate matches the host name in the URL. Peer just verifies whether the certificate provided by the server is authentic against the chain of digital signatures found in ssl_capath. No performs no checks at all. Yes is the secure default, performing host and peer check.
For SSL client certificate authentication use the options ssl_clientcert to define the path to the ssl client certificate and ssl_clientkey to define the path to the SSL client key. Use ssl_capath to change the directory holding the CA certificates (default is /etc/ssl/certs).
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
https://server/path?ssl_clientcert=/entitlement/1234.pem&ssl_clientkey=/entitlement/1234-key.pem
Disk volume (partition) ๐ฝ
Mandatory device parameter specifying the name of the block device to mount. The name of the optional filesystem defaults to "auto".
hd:/subdir?device=/dev/sda1&filesystem=reiserfs
Local directory tree ๐
dir:/directory/name
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 ๐
To use NFSv4 either use schema tnfsv4:// or pass an optional parameter type=nfs4. Additional mountoptions can be passed as comma separated list. Defaults to "ro".
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 ๐ช
There is no difference between cifs and smb scheme (any more). In both cases the cifs filesystem is used. Additional mountoptions can be passed as comma separated list. Defaults to "ro,guest". Specify "noguest" to turn off "guest". This is necessary if Samba is configured to reject guest connections.
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 ๐๏ธ
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, 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) โ new repo, who dis? ๐
addrepo (ar) [options] URI alias
addrepo (ar) [options] FILE*.repo*
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 addrepo -f, or 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.
-r,--repofile.repo โ Read URI and alias from specified.repofile.-c,--checkโ Probe given URI.-C,--no-checkโ Donโt probe URI, probe later during refresh.-n,--namename โ Specify descriptive name for the repository.-e,--enableโ Enable the repository (the default).-d,--disableโ Add the repository as disabled. Repositories are added as enabled by default.-f,--refreshโ Enable autorefresh of the repository. The autorefresh is disabled by default when adding new repositories.-F,--no-refreshโ Disable auto-refresh for the repository.-p,--priority [1-2147483647]|0โ Set the priority of the repository. Priority of1is the highest, and2147483647is the lowest.-p 0will set the priority back to the default (99). Packages from repositories with higher priority will be used even if there are better versions available in a repository with a lower priority.-k,--keep-packagesโ Enable RPM files caching for the repository.-K,--no-keep-packagesโ Disable RPM files caching.-g,--gpgcheckโ Enable GPG check for this repository. The behavior as described in section GPG checks.--gpgcheck-strictโ Enable strict GPG check for this repository. Even packages from signed repositories need a valid GPG signature and using unsigned packages must be confirmed.--gpgcheck-allow-unsignedโ Short hand for--gpgcheck-allow-unsigned-repo--gpgcheck-allow-unsigned-package.--gpgcheck-allow-unsigned-repoโ Enable GPG check but allow the repository metadata to be unsigned.--gpgcheck-allow-unsigned-packageโ Enable GPG check but allow installing unsigned packages from this repository.-G,--no-gpgcheckโ Disable GPG check for this repository.
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. fr fr, be careful ๐ญ
--default-gpgcheckโ Use the global GPG check settings defined in/etc/zypp/zypp.conf. This is the default.
Unless you have modified your zypp.conf settings, this is the same as --gpgcheck, the behavior as described in section GPG checks.
Examples: ๐
$ zypper ar -c -n 'Packman 11.1 repo' http://packman.iu-bremen.de/suse/11.1 packman
Add a HTTP repository, probe it, name it Packman 11.1 repo, and use packman as alias.
$ zypper ar https://download.opensuse.org/repositories/zypp:/svn/openSUSE_Factory/zypp:svn.repo
$ zypper ar myreposbackup.repo
Add repositories from a .repo file.
removerepo (rr) โ repo deletion station ๐
removerepo (rr) [options] alias|name|#|URI...
Delete repositories specified by aliases, names, numbers, URIs or one of the aggregate options.
--loose-authโ Ignore user authentication data in the URI.--loose-queryโ Ignore query string in the URI.-a,--allโ Apply changes to all repositories.-l,--localโ Apply changes to all local repositories.-t,--remoteโ Apply changes to all remote repositories (http/https/ftp).-m,--medium-typetype โ Apply changes to repositories of specified type. The type corresponds to the repository URI scheme identifier likehttp,dvd, etc. You can find complete list of valid types athttp://en.opensuse.org/openSUSE:Libzypp_URIs.
repos (lr) โ the repo list, obvs ๐
repos (lr) [options] [repo]...
List all defined repositories or show detailed information about those specified as arguments ๐
Each repo can print a whole little lineup of data, and honestly? it's giving dashboard energy:
#โ the repository numberAliasโ the unique identifierNameโ the repo's nameEnabledโ whether the repository is enabledGPG Checkโ whether the GPG check for repository metadata (r) and/or downloaded rpm packages (p) is enabledRefreshโ whether auto-refresh is enabled for the repositoryPriorityโ the priorityTypeโ the repository meta-data type:rpm-md,yast2,plaindir
Which of these you actually get to see is decided by the command line options listed below ๐ plus the main.repoListColumns setting from zypper.conf. By default you're served #, Alias, Name, Enabled, GPG Check and Refresh. That's the standard plate, no cap.
The repository number is a unique identifier of the repository in the current set of repositories. But here's the catch bestie โ if you add, remove or change a repository, the numbers may change ๐ญ. Keep that in mind when you use the numbers with the repository handling commands. On the other hand, using the alias instead of the number is always safe ๐ซถ. Alias girlies stay winning.
Wanna see detailed information about specific repositories? Just specify them as arguments โ either by alias, name, number from a simple zypper lr, or by URI. Like:
zypper lr factory
or
zypper lr 2
- *
-e,--export*FILE.repo|-** โ this option causeszypperto write the repository definition of all defined repositories into a single file in repo file format. And if you specify-` instead of a file name, the repositories get written to the standard output โจ. -a,--aliasโ add the alias column to the output.-n,--nameโ add the name column to the output.-u,--uriโ add the base URI column to the output.-p,--priorityโ add the repository priority column to the output.-r,--refreshโ add the autorefresh column to the output.-k,--keep-packagesโ add the keep-packages column to the output. The column shows aYesif keep-packages is explicitly enabled for this repository. Otherwise a-or a+if a.keep_packagesfile in thepkg-cachedirectory exists (see section FILES).-d,--detailsโ show more information like URI, priority, type, etc.-E,--show-enabled-onlyโ show enabled repositories only.-U,--sort-by-uriโ add the base URI column and sort the list by it.-P,--sort-by-priorityโ add the repository priority column and sort the list by it.-A,--sort-by-aliasโ sort the list by alias.-N,--sort-by-nameโ sort the list by name.
Examples, because we love a demo ๐ :
$ zypper repos -e myreposbackup.repo
Backup your repository setup ๐
$ zypper lr -pu
List repositories with their URIs and priorities ๐ธ
renamerepo (nr) alias|name|#|URI new-alias
Assign a new alias to the repository specified by alias, name, number, or URI. Glow-up for your repo's nickname, iconic.
Examples:
$ zypper nr 8 myrepo
Rename repository number 8 to myrepo โ super useful if the repo has some dreadful alias that's not usable on the command line ๐.
modifyrepo (mr) options alias|name|#|URI...
modifyrepo (mr) options --all|--remote|--local|--medium-type
Modify properties of repositories specified by alias, name, number, or URI โ or use one of the aggregate options to hit a whole squad at once ๐
-n,--namename โ set a descriptive name for the repository.-e,--enableโ enable the repository.-d,--disableโ disable the repository.-f,--refresh(legacy:-r) โ enable auto-refresh for the repository.-F,--no-refresh(legacy:-R) โ disable auto-refresh for the repository.-p,--priority [1-2147483647]|0โ set the priority of the repository. Priority1is the highest, and2147483647is the lowest.-p 0will set the priority back to the default (99). Packages from repositories with higher priority will be used even if there are better versions available in a repository with a lower priority. Yes, priority really said "I'm the main character" ๐ฅ.-k,--keep-packagesโ enable RPM files caching.-K,--no-keep-packagesโ disable RPM files caching.-g,--gpgcheckโ enable GPG check for this repository. The behavior as described in section GPG checks.--gpgcheck-strictโ enable strict GPG check for this repository. Even packages from signed repositories need a valid GPG signature and using unsigned packages must be confirmed.--gpgcheck-allow-unsignedโ short hand for--gpgcheck-allow-unsigned-repo --gpgcheck-allow-unsigned-package.--gpgcheck-allow-unsigned-repoโ enable GPG check but allow the repository metadata to be unsigned.--gpgcheck-allow-unsigned-packageโ enable GPG check but allow installing unsigned packages from this repository.-G,--no-gpgcheckโ disable GPG check for this repository.
โ ๏ธ 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. Like, genuinely bestie, don't ๐.
--default-gpgcheckโ use the global GPG check settings defined in/etc/zypp/zypp.conf. This is the default. Unless you've modified yourzypp.confsettings, this is the same as--gpgcheck, the behavior as described in section GPG checks.-a,--allโ apply changes to all repositories.-l,--localโ apply changes to all local repositories.-t,--remoteโ apply changes to all remote repositories (http/https/ftp).-m,--medium-typetype โ apply changes to repositories of the specified type. The type corresponds to the repository URI scheme identifier likehttp,dvd, etc. You can find the complete list of valid types athttp://en.opensuse.org/openSUSE:Libzypp_URIs.
Examples, come get your food ๐:
$ zypper mr -kt
Enable keeping of packages for all remote repositories.
$ zypper mr -er updates
Enable repository updates and switch on autorefresh for the repo.
$ zypper mr -da
Disable all repositories. (Chaos era ๐ญ)
refresh (ref) [alias|name|#|URI]...
Refresh the repositories specified by their alias, name, number, or URI. If no repositories are specified, all enabled repositories will be refreshed. Fresh metadata, fresh me โจ.
-f,--forceโ force a complete refresh of specified repositories. This option will cause both the download of raw metadata and parsing of the metadata to be forced even if everything indicates a refresh is not needed.-b,--force-buildโ force only reparsing of cached metadata and rebuilding of the database. Raw metadata download will not be forced.-d,--force-downloadโ force only download of current copy of repository metadata. Parsing and rebuild of the database will not be forced.-B,--build-onlyโ only parse the metadata and build the database, don't download raw metadata into the cache. This will enable you to repair a damaged database from cached data without accessing the network at all ๐ง.-D,--download-onlyโ only download the raw metadata, don't parse it or build the database.--include-all-archsโ Multi-Arch repos: download raw metadata for all offered architectures even if the repo supports filtering. Otherwise we'd download only the metadata for architectures compatible with the local system. You do not need this unless you wantzypperto provide the full metadata for the purpose of mirroring the repository.-s,--servicesโ refresh also services before refreshing repositories.
clean (cc) [options] [alias|name|#|URI]...
Clean the local caches for all known or specified repositories. By default, only caches of downloaded packages are cleaned. Spring cleaning but make it metadata ๐งน๐.
-m,--metadataโ clean the repository metadata cache instead of the package cache.-M,--raw-metadataโ clean the repository raw metadata cache instead of the package cache.-a,--allโ clean both repository metadata and package caches.
๐ฆ Service Management ๐ฆ
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, the 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 instead.
addservice (as) [options] URI alias
Adds a service specified by URI to the system. The alias must be unique and serves to identify the service. If a service with the same alias and URI already exists, the command behaves like modifyservice and updates the settings accordingly.
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 service is unknown until it is refreshed. Surprise reveal energy ๐.
-n,--namename โ specify a descriptive name for the service.-e,--enableโ enable the service (this is the default).-d,--disableโ add the service as disabled.-f,--refreshโ enable auto-refresh of the service.-F,--no-refreshโ disable auto-refresh of the service.
removeservice (rs) [options] alias|name|#|URI...
Remove the specified service from the system. Removing a service will also remove all of its repositories. Yes, all of them. It's giving consequences ๐.
--loose-authโ ignore user authentication data in the URI.--loose-queryโ ignore query string in the URI.
modifyservice (ms) options alias|name|#|URI
modifyservice (ms) options --all|--remote|--local|--medium-type
Modify properties of specified services.
Common Options
These options are common to all types of services and repositories ๐ซถ.
-n,--namename โ set a descriptive name for the service.-e,--enableโ enable a disabled service.-d,--disableโ disable the service (but don't remove it).-f,--refresh(legacy:-r) โ turn on auto-refresh for the service, bestie. Yes, it keeps itself fresh ๐-F,--no-refresh(legacy:-R) โ turn auto-refresh off. Not every service needs to be that girl.-a,--allโ apply whatever you're doing to all the services.-l,--localโ only the local services, no remote drama.-t,--remoteโ only the remote services, we're being picky.-m,--medium-typetype โ apply changes to services of the specified type. iykyk.
๐ฆ RIS Service Specific Options ๐ฆ
Heads up: services that aren't Repository Index Services literally ignore all of these. They're not being rude, they just don't do RIS things โจ
-i,--ar-to-enablealias โ schedule an RIS service repository to be enabled at the next service refresh.-I,--ar-to-disablealias โ schedule an RIS service repository to be disabled at the next service refresh.-j,--rr-to-enablealias โ remove a RIS service repository from the "to enable" list.-J,--rr-to-disablealias โ remove a RIS service repository from the "to disable" list.-k,--cl-to-enableโ clear the whole list of RIS repositories to enable. bye ๐-K,--cl-to-disableโ clear the whole list of RIS repositories to disable.
services (ls) [options]
Lists the services defined on your system. It's giving inventory energy ๐
-u,--uriโ also show the base URI of repositories.-p,--priorityโ also show repository priority.-d,--detailsโ show more info, like URI, priority and type. The full tea โ-r,--with-reposโ also show the repositories that belong to the services.-P,--sort-by-priorityโ sort the list by repository priority.-E,--show-enabled-onlyโ show enabled services only. Tiny plot twist: if you pair it with--with-repos, then disabled services that own (manually) enabled repositories get shown anyway.-U,--sort-by-uriโ sort the list by URI.-N,--sort-by-nameโ sort the list by name.
refresh-services (refs) [options] alias|name|#|URI...
Refreshing a service = executing that service's special task. That's the whole vibe ๐ซถ
RIS services add, remove, or modify repositories on your system based on the current content of the repository index. But listen โ if the enabled/disabled state differs because you manually called modify-repo on a service repository, that will not be reverted unless the --restore-status option is used, or unless the repository index explicitly requests the change. No cap.
Services only manage defined repositories โ they do not refresh them. If you want the repositories refreshed too, use the --with-repos option or the refresh command.
-f,--forceโ force a complete refresh of the specified services. This forces both the download of raw metadata and the parsing of the metadata, even if everything is screaming that a refresh isn't needed.-r,--with-reposโ refresh the service repositories too.-R,--restore-statusโ also restore service repositories' enabled/disabled state to the repository index default. Super useful after you manually changed the enabled state of some service repositories. we've all been there ๐ญ
๐ Package Locks Management ๐
Package locks exist to prevent changes to the set of installed packages on your system. Locks live as queries in /etc/zypp/locks (peep locks(5) too). Any package matching a query is then forbidden from changing its installed status: an installed package can't be removed or upgraded, and a not-installed package can't be installed. If you try to install, upgrade or remove a locked package, you'll get a dependency problem dialog. It's the system saying "nope, that one's protected" ๐
A lock-spec is formed by "NAME [OP EDITION]", where NAME can also be a glob pattern using * and ? wildcard characters. Non-package types can have their kind-string prepended (e.g. patch:foo or product:baa) or you can use the commands' --type option.
The basic form locks all editions of the matching items. You can optionally restrict the lock to match a specific edition or edition range using =, <, <=, >, >= or != followed by the edition.
Note ๐ If you use blanks around the operator, you need to quote the string or escape the blanks according to the rules of the shell you're using. The shell will absolutely eat your spaces otherwise, fr fr.
locks (ll)
List the currently active package locks.
-m,--matchesโ show the number of resolvables matched by each lock. Heads up: this option requires loading the repositories.-s,--solvablesโ list the resolvables matched by each lock. Also requires loading the repositories.
addlock (al) [options] lock-spec...
Add a package lock. Specify the packages to lock as explained above โจ
-r,--repoalias|name|#|URI โ restrict the lock to the specified repository.-t,--typetype โ lock only packages of the specified type (default:package). See the section Package Types for the list of available package types.-m,--commentcomment โ add a comment for the package lock. little note to future you ๐ซถ
removelock (rl) [options] lock-number|lock-spec...
Remove a package lock. Specify the lock to remove either by its number (the one you got from zypper locks) or by the lock-spec.
-r,--repoalias|name|#|URI โ restrict the lock to the specified repository.-t,--typetype โ restrict the lock to packages of the specified type (default:package). See the section Package Types for the list of available package types.
cleanlocks (cl)
Remove unused locks. ๐งน
This command hunts for locks that currently don't lock any package (with regard to the repositories in use), and for each such lock it asks you whether to remove it. Consent matters, bestie.
๐ธ Locale Management ๐ธ
These commands give you info about requested locales and let you manage them. A locale is defined by a language code. Lots of packages have locale-dependent packages available, which provide translations or dictionaries. To get those installed, the locale for the language you want has to be marked as requested by the package manager library. That's the whole mechanic ๐
locales (lloc) [OPTIONS] [LOCALE] ...
List requested locales. Called with no argument, it lists the locales already marked as requested. If you specify certain locale(s), it prints info only for this(these).
-a,--allโ list all available locales.-p,--packagesโ show corresponding packages.
addlocale (aloc) [OPTIONS] <LOCALE> ...
Add the specified locale(s) to the list of requested locales.
-n,--no-packagesโ do not install corresponding packages.
removelocale (rloc) [OPTIONS] <LOCALE> ...
Remove the specified locale(s) from the list of requested locales.
-n,--no-packagesโ do not remove corresponding packages.
Examples:
$ zypper locales
List requested locales.
$ zypper locales --packages de en
Get the lists of packages which are available for de and en (exact match).
$ zypper locales en_
Get all locales with lang code en that have their own country code, excluding the fallback en.
$ zypper locales en*
Get all locales with lang code en with or without country code.
$ zypper aloc --packages de_CH
Request de_CH and install language dependent packages.
๐ Other Commands ๐
system-architecture
Print the detected system architecture. Short and slay.
versioncmp (vcmp) VERSION1 VERSION2
Compare the two versions you passed as arguments and tell you whether VERSION1 is older or newer than VERSION2, or whether the two version strings match. The exit code is 0 if the versions are equal, 11 if VERSION1 is newer, and 12 if VERSION2 is newer.
Default output is in human-friendly form. But if the --terse global option is used, the result is an integer number: negative/positive if VERSION1 is older/newer than VERSION2, zero if they match. Numbers, but make it vibes.
-m,--matchโ takes the missing release number as any release.
For example:
$ zypper vcmp -m 0.15.3 0.15.3-2
0.15.3 matches 0.15.3-2
$ zypper vcmp 0.15.3 0.15.3-2
0.15.3 is older than 0.15.3-2
targetos (tos)
Shows the ID string of the target operating system. That string is defined by the XPath:/product/register/target entry in (current-rootdir)/etc/products.d/baseproduct.
If the baseproduct doesn't provide this entry, or if no baseproduct is installed at all, the value is empty when the --terse global option is used.
In not-terse mode, the distribution label is shown instead of an empty value, if a baseproduct is installed. so at least you're not staring at nothing ๐
-l,--labelโ show the baseproduct's distribution and short label instead.
licenses
Prints a report about licenses and EULA's of installed packages to standard output. Legal girlie hour ๐
First, a list of all packages and their licenses and/or EULAs is shown. Then comes a summary, including the total number of installed packages and the number of installed packages with EULAs that required a confirmation from the user. Since EULAs aren't stored on the system and can only be read from repository metadata, the summary also includes the number of installed packages that have their counterpart in repositories. The report ends with a list of all licenses used by the installed packages.
This command is genuinely useful for companies redistributing a custom distribution (like appliances) to figure out what licenses they're bound by. fr fr, read it before you ship ๐ซถ
download [OPTIONS]
Download the rpms specified on the command line to a local directory.
By default, packages are downloaded to the libzypp package cache (/var/cache/zypp/packages; for non-root users $XDG_CACHE_HOME/zypp/packages), but you can change that with 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. On 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/pac.../zypper-1.9.17-26.1.x86_64.rpm"/>
</download-result>
--all-matchesโ download all versions that match the commandline arguments. Otherwise only the best version of each matching package gets downloaded. ๐--dry-runโ donโt download a single package, just report what would be done. Zero actual downloading, all the intel. ๐-r,--repoalias|name|#|URI โ work only with the repository specified by the alias, name, number or URI. This option can be used multiple times. ๐ซถ--fromalias|name|#|URI โ select packages from the specified repository only. This option can be used multiple times. โจ
๐ธ source-download [OPTIONS]
Download source rpms for all installed packages to a local directory. Itโs giving โgotta have the source, bestie.โ ๐
-d,--directorydir โ download all source rpms to this directory. Default is/var/cache/zypper/source-download. ๐--deleteโ delete extraneous source rpms in the local directory. This is the default. ๐งน--no-deleteโ do not delete extraneous source rpms. Keep the clutter, I guess. ๐--statusโ donโt download any source rpms, but show which source rpms are missing or extraneous. Just a little status check. ๐ฆ
๐ฅ ps [OPTIONS]
After each upgrade or removal of packages, there may be running processes on the system which continue to use meanwhile deleted files. zypper ps lists all processes using deleted files, together with the corresponding files, and a service name hint, in case itโs a known service. This gives a hint which services may need to be restarted after an update. Usually programs which continue to use deleted shared libraries. ๐ญ
The list contains the following information:
PIDโ ID of the processPPIDโ ID of the parent processUIDโ ID of the user running the processLoginโ login name of the user running the processCommandโ command used to execute the processServiceโ service name, if command is associated with a system serviceFilesโ the list of the deleted files-s,--shortโ create a short table not showing the deleted files. Given twice, show only processes which are associated with a system service. Given three times, list the associated system service names only. โจ--printformat โ for each associated system service print format on the standard output, followed by a newline. Any%sdirective in format is replaced by the system service name. ๐-d,--debugFilefilename โ output a file with all proc entries that make it into the final set of used open files. This can be submitted as additional information in a bug report. ๐
โจ Examples:
$ zypper ps -ss
Show only processes associated with a system service.
$ zypper ps -sss
Short for zypper ps --print "%s"; list services which might
need a restart.
$ zypper ps --print "systemctl status %s"
Let zypper print the commands to retrieve status information
for services which might need a restart.
๐ needs-rebooting
Checks if the reboot-needed flag was set by a previous update or install of a core library or service. ๐ซก
The reboot-needed flag is set if a package that provides installhint(reboot-needed) is updated or installed. Additionally there is a predefined list (/etc/zypp/needreboot) of well-known packages which cause the reboot-needed flag being set unconditionally. The exit code ZYPPER_EXIT_INF_REBOOT_NEEDED indicates that a reboot is suggested, otherwise the exit code is set to ZYPPER_EXIT_OK. ๐จ
It is recommended for scripts to use this command to test whether a system reboot is suggested. Use the --quiet global option (before the command name) to suppress the normal output. ๐คซ
๐ซ Subcommands
๐ง subcommand
Lists available subcommands in /usr/lib/zypper/commands and from elsewhere on your $PATH. See section SUBCOMMANDS for details. ๐
โจ GLOBAL OPTIONS โจ
These are the vibes you can set for any zypper command, bestie. Like the outfit you put on before you go anywhere ๐
-h,--helpโ the ultimate "wait what does this do" button. And if you pair it with a command (--helpnext to a command), you get help that's specific to that command. Iconic.-V,--versionโ prints the zypper version number and dips out. That's it, that's the whole job.-c,--configfile โ use this zypper config file instead of the defaultzypper.conf. But heads up: other command line options you pass alongside--configthat also exist in the zypper config file still win. Command line stays the main character ๐
The order of preference with --config is literally this, in order:
- Command line options
--configfile[/etc/zypp/zypp.conf](system-wide defaults for all libzypp based applications)
Note: the use and location of the system-wide/etc/zypp/zypp.confcan not be changed this way. It's only mentioned here because some zypper command line options let you overwrite system-wide defaults that are defined inzypp.conf.
Also peep the FILES section for more info ๐ซถ
-v,--verboseโ turn the volume up on details. Want debugging output? Specify this option twice, bestie. Likezypper -vv reffor example โ that'll show you the mirrors used to download the metadata. Very "show me everything" of it.-q,--quietโ suppress normal output. Brief messages (especially result notifications) and error messages will still print though, don't worry. And if you use it together with the conflicting--verboseoption,--verbosetakes preference. verbose girlies win ๐--color,--no-colorโ whether to use colors in output, if the tty supports it. Deets are in the[color]section ofzypper.conf. Aesthetic choices, we love to see them ๐-A,--no-abbrevโ do not abbreviate text in tables. By default zypper tries to abbreviate text in some columns so the table fits the width of your screen. If you need to see the whole text, use this option. No more "wait what was cut off" ๐ญ-t,--terseโ terse output, for machine consumption. Implies--no-abbrevand--no-color. Robots only, no glamour.-s,--table-styleinteger โ pick among different predefined line drawing character sets for drawing tables. The style is identified by an integer number:- Style
0is the default. - Styles
1-9use combinations of different box drawing characters, whose shape may depend on the font the terminal is using. - Style
10separates columns by a colon. - Style
11draws no lines at all.
- Style
Table fashion show, honestly ๐
-n,--non-interactiveโ switches to non-interactive mode. No asking you to type answers to prompts; it uses default answers automatically. Those default answers also depend on other options like--no-gpg-checksor--ignore-unknown. Bestie is on autopilot โจ--non-interactive-include-reboot-patchesโ in non-interactive mode, do not skip patches that have therebootSuggested-flag set. Otherwise those patches are considered interactive, like patches including a license or some message to confirm.
NOTE: this option does not turn on non-interactive mode. It just changes what happens once you're already there ๐
-x,--xmloutโ switches to XML output. Super useful for scripts or graphical frontends using zypper. Machine-readable slay.-i,--ignore-unknownโ ignore unknown packages. Very useful for scripts, because when installing in--non-interactivemode, zypper expects every command line argument to match at least one known package. Unknown names or globbing expressions with no match are treated as an error โ unless you use this option.
For search and info commands, this option makes zypper return ZYPPER_EXIT_OK rather than ZYPPER_EXIT_INF_CAP_NOT_FOUND if the query didn't produce at least one match. Exit codes matter, iykyk.
-D,--reposd-dirdir โ use the specified directory to look for the repository definition (.repo) files. Default value is/etc/zypp/repos.d.--servicesd-dirdir โ use the specified directory to look for the service definition (.service) files. Default value is/etc/zypp/services.d.-C,--cache-dirdir โ use an alternative root directory for all caches. Default value is/var/cache/zypp.--raw-cache-dirdir โ use the specified directory for storing raw copies of repository metadata files. Default value is/var/cache/zypp/raw.--solv-cache-dirdir โ use the specified directory to store the repository metadata cache database files (solv files). Default value is/var/cache/zypp/solv.--pkg-cache-dirdir โ use the specified directory for storing rpm packages downloaded from repositories (seeaddrepo --keep-packages). Default value is/var/cache/zypp/packages. Packages are stored in subdirectories named after the repositories alias and using the same path as on the repositories medium. Organized queen ๐๏ธ--userdatastring โ user data is expected to be a simple string without special chars or embedded newlines, and may serve as a transaction id. It gets written to all install history log entries created throughout this specific zypper call. It's also passed on to zypp plugins executed during commit โ which lets, say, a btrfs plugin tag created snapshots with this string. For zypper itself this string has no special meaning. It's just a little name tag for your transaction ๐ท๏ธ
๐ฆ Repository Options ๐ฆ
--no-gpg-checksโ ignore GPG check failures and continue. If a GPG issue happens while using this option, zypper prints and logs a warning and automatically continues without interrupting the operation.
Use this option with caution, because you can easily overlook security problems by using it. (see section GPG checks) Please be careful bestie, I'm begging ๐ญ
--gpg-auto-import-keysโ if a new repository signing key is found, don't ask what to do; trust and import it automatically. This option means the new key is imported even in non-interactive mode, where it would otherwise get rejected. Trust fall, but make it cryptographic ๐-p,--plus-repoURI โ use an additional repository for this operation. The repository aliasedtmp#and named by the specified URI gets added for this operation and removed at the end. You can specify this option multiple times โ stack 'em up ๐ซ--plus-contenttag โ additionally use disabled repositories denoted by tag for this operation. If tag matches a repositories alias, name or URL, or is a keyword defined in the repositories metadata, the repository gets temporarily enabled for this operation. It'll then be refreshed and used according to the commands rules. You can specify this option multiple times.
If a disabled repositories metadata are not available in the local cache, they will be downloaded to scan for matching keywords. Otherwise the keyword scan will use the metadata available in the local cache. Only if used together with the refresh command, a keyword scan will refresh all disabled repositories.
To refresh all disabled repositories metadata:
zypper --plus-content '' ref
To include a disabled repository repo-debug in a search:
zypper --plus-content repo-debug search ...
To search only in a disabled repository repo-debug:
zypper --plus-content repo-debug search -r repo-debug ...
To enable all repos providing the debug keyword:
zypper in --plus-content debug some -debuginfo or -debugsource package
Sneaky little temporary-enable, love her ๐
--disable-repositoriesโ do not read metadata from repositories. This prevents loading of packages from repositories, so zypper works only with the installed packages (if--disable-system-resolvableswas not specified). Offline era.--no-refreshโ do not auto-refresh repositories (ignore the auto-refresh setting). Useful to save time when doing operations likesearch, if there's no need to have completely up to date metadata. We love a shortcut โญ--no-cdโ ignore CD/DVD repositories. With this option, zypper acts as if the CD/DVD repositories were not defined at all. Not a disc girlie today ๐ฟ--no-remoteโ ignore remote repositories like http, ftp, smb and similar. Makes using zypper easier when you're offline. With this option, zypper acts as if the remote repositories were not defined at all. Airplane mode activated โ๏ธ--releaseverversion โ for the current command, set the value of the$releaseverrepository variable to version. This can be used to switch to new distribution repositories when performing a distribution upgrade. See thedist-upgrade(dup) command and sectionRepository Managementfor more details about using the$releaseverrepository variable.
To check where you already use $releasever, call:
zypper --releasever @--HERE--@ lr -u
๐ฏ Target Options ๐ฏ
-R,--rootdir โ operates on a different root directory. This option influences the location of therepos.ddirectory and the metadata cache directory, and it also causes rpm to be run with the--rootoption to do the actual installation or removal of packages. See also theFILESsection. Big "I live here now" energy ๐--installrootdir โ behaves like--rootbut shares the repositories with the host system. Same vibe, shared closet.--disable-system-resolvablesโ this one serves mainly for testing purposes. It causes zypper to act as if there were no packages installed in the system.
Use with caution, as you can damage your system using this option. Fr fr, this is the dangerous one, don't just yolo it ๐
๐ง SUBCOMMANDS ๐ง
Zypper subcommands are inspired by git(1). They're standalone executables that live in the zypper_execdir (/usr/lib/zypper/commands). For subcommands, zypper provides a wrapper that knows where the subcommands live, and runs them by passing command options and arguments to them. If a subcommand isn't found in the zypper_execdir, the wrapper will look in the rest of your $PATH for it. So it's totally possible to write local zypper extensions that don't live in system space. You can disable this by setting "subcommand.seachSubcommandInPath" to "no" in the zypper.conf. Make it your own, bestie ๐ฆ
This is how to add your own subcommand zypper mytask:
- The executable must be named
zypper-mytask. - The executable must be located your
$PATH. - A manpage for
zypper-mytaskshould be provided and explaining the commands options and return values. It will be shown when callingzypper help mytask. - Zypper built-in commands take precedence over subcommands with the same name. Built-ins stay on top ๐
- It's fine to call zypper or use libzypp from within your subcommand.
You can use the built-in zypper subcommand command to get a list of all subcommands in zypper_execdir and from elsewhere on your $PATH.
Using zypper global-options together with subcommands, as well as executing subcommands in zypper shell is currently not supported. Not yet, anyway ๐
๐ธ FILES ๐ธ
Okay bestie, this is the map of where zypper keeps all its stuff. Every path, every file, all of it ๐
/etc/zypp/zypper.conf,$HOME/.zypper.confโ the global (system-wide) and the user's own config file for zypper. These get read when zypper starts up, unless you passed the--configoption.
User settings win over global settings, periodt. And in the same way, command line options override whatever's in either of those files. So to sum it all up, here's the order of preference, highest to lowest ๐ซถ:
- Command line options
$HOME/.zypper.conf/etc/zypp/zypper.conf- [
/etc/zypp/zypp.conf] (system-wide defaults for all libzypp based applications)
Peep the comments in /etc/zypp/zypper.conf for a list and description of what options you can set.
Quick note, bestie: the system-wide/etc/zypp/zypp.confis only mentioned here because some zypper command line options let you overwrite system-wide defaults defined in there.zypp.confandzypper.confhave different content and serve different purposes โ don't mix them up ๐.
/etc/zypp/zypp.confโ the ZYpp configuration file, and it affects all libzypp based applications. Read the comments in the file for a description of the configurable properties. Lowkey, a lot of the file and directory locations listed in this section are configurable viazypp.conf. The location of this file itself can only be redefined by setting$ZYPP_CONFin the environment./etc/zypp/locksโ the file with package lock definitions. Use the package lock commands (locks,addlock,removelock, etc.) to mess with this file, okay? That's the vibe.
This file is used by all ZYpp-based applications.
/etc/zypp/repos.dโ the directory holding repository definition (*.repo) files. You can use the Repository Management commands to manipulate these files, or you can edit them yourself, whatever floats your boat. Either way, after you're done modifying, runningzypper refreshis strongly recommended โจ.
You can use the --reposd-dir global option to point at a different directory for this, or the --root option to make this directory relative to the root directory you specified.
This directory is used by all ZYpp-based applications.
/etc/zypp/services.dโ the directory holding service definition (*.service) files. You can use the Service Management Commands to manipulate these files, or edit them yourself. Runningzypper refsis recommended after you've made modifications.
You can use the --servicesd-dir global option for an alternative directory here, or --root to make it relative to your specified root directory.
This directory is used by all ZYpp-based applications.
/usr/lib/zypper/commandsโ the system directory containing zypper extensions (see the SUBCOMMANDS section ๐)./var/cache/zypp/rawโ where the raw metadata contained in repositories gets stored. Use the--raw-cache-dirglobal option for an alternative directory, or--rootto make this directory relative to the root directory you specified.
This directory is used by all ZYpp-based applications.
/var/cache/zypp/solvโ the directory containing preparsed metadata in the form of solv files.
This directory is used by all ZYpp-based applications.
/var/cache/zypp/packagesโ if thekeep-packagesproperty is set for a repository (see themodifyrepocommand), all the RPM files downloaded during installation get kept right here. Packages are stored in subdirectories named after their repositories alias.
Subdirectories of removed or otherwise unknown repositories get cleaned automatically. This auto-cleanup can be prevented by creating a file named .no_auto_prune in the pkg-cache directory.
Creating a .keep_packages file in the pkg-cache directory keeps downloaded packages for all repos cached here, overwriting the repositories' keep-packages property.
See also the clean command for cleaning these cache directories ๐งน.
This directory is used by all ZYpp-based applications.
/var/log/zypper.logโ the zypper log file. Attach it to all bugreports, no cap. (see alsozypper-log(8))./var/log/zypper.solverTestCaseโ the solver testcase created by using the--debug-solveroption./var/log/updateTestcase-YYYY-MM-DD-hh-mm-ssโ the solver testcase auto created when performing azypper dup./var/log/zypp/historyโ installation history log.~/.zypper_historyโ command history for the zypper shell (see theshellcommand)./etc/zypp/needrebootโ file with a list of packages that will set the reboot-needed flag when installed or upgraded./etc/zypp/needreboot.dโ a directory you can use to define packages that trigger the reboot-needed flag, by adding additional files containing the required package names.
๐ EXIT CODES ๐
There are several exit codes defined for zypper built-in commands, for use in things like scripts. These codes are defined in the header file src/zypper-main.h found in the zypper source package. Codes below 100 denote an error, codes above 100 give you specific info, and 0 means a normal successful run. Here's the full list with descriptions, bestie ๐
0โZYPPER_EXIT_OKโ successful run of zypper with no special info. Slay ๐1โZYPPER_EXIT_ERR_BUGโ an unexpected situation occurred, probably caused by a bug. Not us, it's a bug ๐ญ2โZYPPER_EXIT_ERR_SYNTAXโ zypper was invoked with an invalid command or option, or a bad syntax.3โZYPPER_EXIT_ERR_INVALID_ARGSโ some of the provided arguments were invalid. E.g. an invalid URI was provided to theaddrepocommand.4โZYPPER_EXIT_ERR_ZYPPโ a problem is reported by the ZYPP library.5โZYPPER_EXIT_ERR_PRIVILEGESโ the user invoking zypper has insufficient privileges for the specified operation. (You need the sudo, bestie ๐)6โZYPPER_EXIT_NO_REPOSโ no repositories are defined.7โZYPPER_EXIT_ZYPP_LOCKEDโ the ZYPP library is locked, e.g. packagekit is running.8โZYPPER_EXIT_ERR_COMMITโ an error occurred during installation or removal of packages. You may runzypper verifyto repair any dependency problems.100โZYPPER_EXIT_INF_UPDATE_NEEDEDโ returned by thepatch-checkcommand if there are patches available for installation.101โZYPPER_EXIT_INF_SEC_UPDATE_NEEDEDโ returned by thepatch-checkcommand if there are security patches available for installation.102โZYPPER_EXIT_INF_REBOOT_NEEDEDโ returned by theneeds-rebootingcommand, if a system reboot is suggested.
Legacy: returned after the successful installation of a patch which requires reboot of the computer. This legacy behavior is kept, but its drawback is that it covers patches only, no packages. The new needs-rebooting command is the recommended way to test whether a system reboot is suggested โจ.
103โZYPPER_EXIT_INF_RESTART_NEEDEDโ returned after a successful installation of a patch which requires restart of the package manager itself. Meaning: one of the patches to be installed affects the package manager itself, and the command used (e.g.zypper update) needs to be executed once again to install any remaining patches. Round two, bestie ๐ฅ104โZYPPER_EXIT_INF_CAP_NOT_FOUNDโ returned by theinstalland theremovecommand in case any of the arguments does not match any of the available (or installed) package names or other capabilities. Insearchandinfocommands it indicates that no match was found. See also the--ignore-unknownglobal option.105โZYPPER_EXIT_ON_SIGNALโ returned upon exiting after receiving aSIGINTorSIGTERM.106โZYPPER_EXIT_INF_REPOS_SKIPPEDโ some repository had to be disabled temporarily because it failed to refresh. You should check your repository configuration (e.g.zypper ref -f).107โZYPPER_EXIT_INF_RPM_SCRIPT_FAILEDโ installation basically succeeded, but some of the packages'%postinstall scripts returned an error. These packages were successfully unpacked to disk and are registered in the rpm database, but due to the failed install script they may not work as expected. The failed scripts' output might reveal what actually went wrong. Any scripts output is also logged to/var/log/zypp/history.
Zypper subcommands (see section SUBCOMMANDS) may return different codes, which should be described in the commands man page. Call zypper help subcommand to see the subcommands man page if one is provided.
๐ฆ HOMEPAGE ๐ฆ
https://github.com/openSUSE/zypper
๐ AUTHORS ๐
The zypper project was started by Martin Vidner, Jan Kupec, Michael Andres, Duncan Mac-Vicar Prett, Josef Reidinger and Stanislav Visnovsky. Many people have later contributed to it. Legends, all of them ๐ซถ
๐ SEE ALSO ๐
locks(5), zypper-log(8), YaST2(8)
That's the whole page, bestie โ you made it to the end ๐ Go forth and zypper responsibly ๐ This masterclass in package management came to you from the SUSE Linux crew, dated 2026-10-27, and it's filed under the name ZYPPER(8) โญ
๐ฆ where this page comes from
- arch rolling: zypper 1.14.102-1 ยท GPL-2.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms