Zypper

On this page 8

Zypper is the command-line package manager of openSUSE and SUSE Linux Enterprise. In Linux package management, it installs, removes, updates and queries RPM packages from configured repositories, and it resolves dependencies automatically through the libzypp library and its SAT-based solver.

Zypper plays the same role on SUSE systems that APT plays on Debian and DNF plays on Fedora. It shares its engine with the graphical YaST software module, offers patch-based updates for enterprise maintenance and handles the rolling-release upgrades of openSUSE Tumbleweed with a dedicated distribution upgrade command.

How Zypper resolves and installs packages

Zypper itself is a front end. The heavy work happens in libzypp, which downloads repository metadata, builds a pool of all available and installed packages and passes the request to libsolv, a solver that models dependencies as a Boolean satisfiability (SAT) problem. This approach finds a consistent solution quickly even with tens of thousands of packages.

When no clean solution exists, Zypper does not guess silently. It presents numbered solution options, such as removing a conflicting package or keeping an older version, and asks the administrator to choose. After confirmation, packages are downloaded, verified against GPG signatures and installed through the RPM database.

LayerResponsibilityNotes
ZypperCommand-line interfaceParses commands and shows results
libzyppRepositories, metadata, transactionsAlso used by YaST and PackageKit back ends
libsolvDependency resolutionSAT solver with fast pool handling
RPMInstall files, run scripts, keep the databaseLow-level package format and tool
Layers involved in a Zypper transaction

Essential Zypper commands

Zypper commands have long names and short aliases, for example install and in, or refresh and ref. Most actions require root privileges, while search and info queries can run as a normal user.

CommandShort formPurpose
zypper refreshrefUpdate repository metadata
zypper install PKGinInstall packages and dependencies
zypper remove PKGrmRemove packages
zypper updateupUpdate installed packages within the same release
zypper dist-upgradedupUpgrade the distribution, required on Tumbleweed
zypper patchnoneApply official maintenance patches
zypper search TERMseSearch package names and summaries
zypper addlock PKGalPrevent a package from being changed
Frequently used commands

Useful global options include –non-interactive for scripts, –dry-run to preview a transaction without changing the system, and --download-only to fetch packages in advance. After updates, zypper ps lists processes that still use deleted files, showing which services need a restart.

Repositories, priorities and vendor changes

Repositories are defined in files under /etc/zypp/repos.d and managed with zypper addrepo, zypper modifyrepo and zypper repos. Each repository has a priority from 1 to 99, where a lower number means higher priority; the default is 99. When several repositories offer the same package, Zypper prefers the one with the higher priority.

Zypper also tracks the vendor of each package. By default, it will not silently switch an installed package from the official openSUSE vendor to a third-party repository such as Packman. Switching requires an explicit choice, for example zypper dup --from REPO --allow-vendor-change, which protects systems from accidental mixing of package sources.

SituationRecommended commandReason
openSUSE Tumbleweedzypper dupRolling release needs full distribution upgrades
openSUSE Leap point releasezypper up or zypper patchKeeps the system within the release
SUSE Linux Enterprise serverzypper patchApplies tested and classified fixes
Major Leap version upgradezypper dup after changing repositoriesMoves the system to the new release
Update commands and when to use them

Patches and maintenance on SUSE systems

A distinctive Zypper feature is the patch, a metadata object published by the distribution that groups the package updates needed to fix one problem. Each patch carries a category, such as security, recommended, optional or feature, and a severity rating, so administrators can apply exactly the fixes their policy requires.

Commands such as zypper list-patches --category security and zypper patch --cve CVE-ID let teams target specific vulnerabilities and document which advisories have been applied. Some patches update the package stack itself; Zypper installs those first and then asks to run again, which keeps the update tool consistent before other fixes are processed.

Patches that require a reboot or service restart are flagged in their metadata. In enterprise environments, this information feeds into maintenance windows and compliance reports, which is one reason SUSE administrators often prefer zypper patch over a plain package update.

Zypper compared with other package managers

All mainstream Linux package managers solve the same problem, but they differ in package format, solver design and update model. Zypper and DNF both use RPM, yet their repositories and conventions are not interchangeable between distributions.

ToolDistributionsPackage formatDistinctive trait
ZypperopenSUSE, SUSE Linux EnterpriseRPMPatches, vendor stickiness, libsolv
DNFFedora, RHEL and derivativesRPMModular plugins, also uses libsolv
APTDebian, UbuntuDEBVery large repository ecosystem
PacmanArch LinuxTar-based packagesSimple and fast, rolling release
Zypper among common package managers

Universal formats such as Flatpak and Snap complement rather than replace Zypper: they deliver desktop applications with their own runtimes, while Zypper continues to manage the base system and its libraries.

Pitfalls and good practice

  • Using zypper up on Tumbleweed can leave the system partially upgraded; the supported command is zypper dup.
  • Mixing too many third-party repositories increases conflicts and unexpected vendor changes.
  • Running dup with –non-interactive blindly can accept package removals that deserved review.
  • Skipping snapshots: on Btrfs systems, Snapper creates pre- and post-transaction snapshots that allow a rollback, and they should stay enabled.
  • Ignoring zypper ps after updates leaves services running old, vulnerable library code.

A plain-language summary

Zypper is the software installer and updater for SUSE Linux systems. An administrator types what is needed, and Zypper finds the program in trusted online stores called repositories.

It also works out what else the program depends on and installs those pieces too. Before anything changes, it shows a plan and asks for approval. It works like a careful shop assistant who checks that every part fits before handing over the order.

An example from practice

A system administrator maintains a dozen openSUSE Tumbleweed workstations in a design studio. Every Monday, a maintenance script runs zypper ref and then zypper dup --dry-run and sends the planned changes to the administrator, who reviews any proposed package removals.

One week, the dry run shows that a multimedia codec package would switch vendor because of a conflict with the Packman repository. The administrator resolves it by setting the Packman priority to 90 and confirming the vendor change explicitly. The real upgrade then runs, and Snapper records snapshots before and after the transaction.

On one workstation, a graphics driver regression appears after the upgrade. The administrator rolls back to the pre-update snapshot within minutes and locks the driver package with zypper al until a fixed version arrives. The outcome is a routine that keeps all machines current while limiting downtime to a single short reboot.