How To

zypper Command Cheat Sheet for openSUSE Leap

If you came to openSUSE from Debian or Fedora, the command that catches you out is the upgrade one. On Leap, zypper dup does not mean what it means on a rolling release, and reaching for it out of habit is how a stable system gets pulled apart. So this zypper cheat sheet leads with that distinction and groups every other command by the task you are actually doing, with the trade-offs that matter flagged in place.

Original content from computingforgeeks.com - post 168913

We ran each command on a live openSUSE Leap 16 box in June 2026, so the output and the gotchas below are real, not transcribed from a man page.

Grab the printable zypper cheat sheet

A one-page PDF with every command on this page, grouped by task. Free to print and pin above your desk.

Download the PDF cheat sheet

zypper Cheat Sheet (Quick Reference)

Run write operations (install, remove, repo changes, upgrades) with sudo. Read operations (search, info, list) work as a normal user. Most subcommands have a short alias, shown in parentheses below.

Update and upgrade

CommandWhat it does
zypper refRefresh repository metadata (alias: ref)
zypper upUpdate installed packages to newer versions
zypper luList available updates without installing
zypper patchApply official maintenance patches (security and bugfix)
zypper patch-checkCount needed patches and security patches
zypper dupDistribution upgrade, for release jumps and vendor changes

Install and remove

CommandWhat it does
zypper in nginxInstall one or more packages (alias: in)
zypper in -y nginxInstall without the confirmation prompt
zypper rm nginxRemove a package (alias: rm)
zypper rm -u nginxRemove a package and its now-unused dependencies
zypper in --from packman ffmpegInstall from one specific repository
zypper install-new-recommendsPull newly recommended packages (e.g. after adding NVIDIA)

Search and inspect

CommandWhat it does
zypper se vimSearch package names and summaries (alias: se)
zypper se -s vimSearch showing version, arch, and repo
zypper se --provides /usr/bin/digFind which package provides a file or capability
zypper if zypperShow package info: version, repo, size (alias: if)
zypper ptList available patterns (package groups)
zypper in -t pattern devel_basisInstall a whole pattern at once

Repository management

CommandWhat it does
zypper lrList configured repositories (alias: lr)
zypper lr -uList repositories with their URIs
zypper ar URL aliasAdd a repository (alias: ar)
zypper mr -d aliasDisable a repository
zypper mr -e aliasEnable a repository
zypper rr aliasRemove a repository (alias: rr)

Locks and cleanup

CommandWhat it does
zypper al dockerAdd a lock to hold a package at its current version
zypper llList active package locks
zypper rl dockerRemove a package lock
zypper ps -sShow services that need restarting after updates
zypper clean -aClear cached metadata and downloaded packages
zypper purge-kernelsRemove old kernels per the multiversion policy

Release upgrade (Leap 15 to 16)

CommandWhat it does
sudo opensuse-migration-toolGuided 15.6 to 16 migration (the supported path)
sudo zypper --releasever 16.0 refPoint repository metadata at the 16.0 release
sudo zypper --releasever 16.0 dup --allow-vendor-changeManual release upgrade
sudo zypper dup --from packman --allow-vendor-changeSwitch multimedia packages to Packman

zypper up vs patch vs dup: the one thing to get right

This is where people coming from Arch or Tumbleweed get burned. On Leap, the three update commands are not interchangeable.

zypper patch is the day-to-day command on Leap. It applies only the official maintenance updates (security fixes and bugfixes) that SUSE has released for your installed version. Check what is pending first:

sudo zypper patch-check

The output tells you exactly how many patches are waiting and how many are security-related:

Loading repository data...
Reading installed packages...

0 patches needed (0 security patches)

zypper up updates installed packages to the newest version available in your repositories, without applying patch metadata. On Leap 16, where the old separate update repository is folded into the main repo, it overlaps with patch for most updates, but patch is the one SUSE tooling and documentation treats as canonical, because it respects patch categories and reboot flags. Use up when you want every newer package, not just the ones bundled into a patch.

zypper dup is the heavy hammer. It is a distribution upgrade: it will downgrade, swap vendors, and remove packages to make your system match the target repositories exactly. On a rolling release like Tumbleweed you run dup every day. On Leap you do not run it for routine updates. Save it for release jumps (15 to 16) and for switching a set of packages to Packman. Running a bare dup on Leap with a third-party repo enabled is the fastest way to pull in surprise vendor changes.

The short rule: patch to stay current and secure, up to pull newer versions, dup only for release upgrades and deliberate repo switches.

Search before you install. The plain se matches names and summaries:

zypper se vim

Each match shows the status column on the left (a leading i means already installed), the name, a summary, and the type:

S  | Name               | Summary                                | Type
---+--------------------+----------------------------------------+--------
   | gvim               | A GUI for Vi                           | package
   | neovim             | Vim-fork focused on extensibility      | package
   | meson-vim          | Vim syntax highlighting for meson      | package

Add -s to see versions, architecture, and which repo each candidate comes from. That matters when the same package exists in both the OSS repo and Packman. To inspect a single package before committing, use if:

zypper if zypper

It prints the installed version, source repo, size, and a description, so you can confirm where a package would come from:

Information for package zypper:
-------------------------------
Repository     : repo-oss (16.0)
Name           : zypper
Version        : 1.14.95-160000.1.1
Arch           : x86_64
Vendor         : SUSE LLC <https://www.suse.com/>
Installed Size : 7.4 MiB
Installed      : Yes (automatically)
Status         : up-to-date

Install with in, remove with rm. Adding -u on removal cleans up dependencies that nothing else needs anymore. For whole environments rather than single packages, install a pattern: sudo zypper in -t pattern devel_basis pulls the full build toolchain in one shot. List the available patterns with zypper pt.

Manage repositories on Leap 16

List what you have, with URIs, so you can see exactly where packages resolve from:

zypper lr -u

A default Leap 16 install shows the OSS, non-OSS, and openh264 repos. Note the alias format changed in Leap 16: the non-free repo is now openSUSE:repo-non-oss, not the bare repo-non-oss that older guides reference. Use the full alias in any command that names it:

# | Alias                   | Name                | Enabled | Refresh | URI
--+-------------------------+---------------------+---------+---------+--------------------------------------------------
2 | openSUSE:repo-non-oss   | repo-non-oss (16.0) | Yes     | Yes     | http://cdn.opensuse.org/distribution/leap/16.0/repo/non-oss/x86_64
4 | openSUSE:repo-openh264  | repo-openh264       | Yes     | Yes     | https://codecs.opensuse.org/openh264/openSUSE_Leap_16
5 | openSUSE:repo-oss       | repo-oss (16.0)     | Yes     | Yes     | http://cdn.opensuse.org/distribution/leap/16.0/repo/oss/x86_64

Add a third-party repo with ar, giving it a URL and a short alias. Packman, the community multimedia repo, is the most common addition:

sudo zypper ar -cfp 90 https://ftp.gwdg.de/pub/linux/misc/packman/suse/openSUSE_Leap_16.0/ packman

The flags earn their place: -c probes that the URI is a valid repo, -f turns on autorefresh, and -p 90 sets a higher priority (lower number wins) so Packman builds are preferred for the packages it ships. Enable or disable a repo without deleting it using mr -e and mr -d, refresh a single repo with zypper ref packman, and drop one entirely with rr. The full codec and Packman walkthrough lives in the post-install guide.

Upgrade Leap 15 to Leap 16 with zypper

Leap 16 is the first major release in years, and the supported jump from 15.6 is the new migration tool, not a hand-rolled dup. Make sure 15.6 is fully patched and snapshotted first, then run:

sudo zypper install opensuse-migration-tool
sudo opensuse-migration-tool

It walks you through choosing the migration target, disabling third-party repositories (leaving repos like Packman enabled is a common cause of migration conflicts), and running the upgrade transaction. If you prefer to drive it by hand, the manual equivalent points the release version at 16.0 and forces a vendor change:

sudo zypper --releasever 16.0 ref
sudo zypper --releasever 16.0 dup --allow-vendor-change --download-in-advance

This is one of the few times a dup belongs on Leap. The full tested walkthrough, including the post-migration SELinux switch and the repo checklist, is in the Leap 15 to 16 upgrade guide. Starting clean instead? See the Leap 16 install guide.

Locks, reboot checks, and cleanup

After any sizeable update, ask whether a restart is actually needed instead of guessing:

sudo zypper ps -s

It lists running processes using files that have since been updated, and tells you plainly when a reboot is unnecessary:

No processes using deleted files found.

No core libraries or services have been updated since the last system boot.
Reboot is probably not necessary.

To pin a package at its current version (handy for Docker or a kernel module you do not want bumped), add a lock with zypper al docker, review locks with zypper ll, and lift one with zypper rl docker. When disk space gets tight, sudo zypper clean -a clears the metadata and download caches, and sudo zypper purge-kernels trims old kernels according to the multiversion policy. Pair these with Snapper snapshots and rollback and you can update aggressively without fear.

Pick the right command and move on

If you remember nothing else: zypper patch for routine security and bugfix updates, zypper in and zypper rm for packages, zypper lr and zypper ar for repos, and dup reserved for the once-in-a-few-years release upgrade. That covers the vast majority of what you will type on a Leap box. Keep the PDF nearby for the flags you reach for less often, and dig into what changed in Leap 16 if a command behaves differently than it did on 15.

Keep reading

Claude Code Cheat Sheet – Commands, Shortcuts, Tips AI Claude Code Cheat Sheet – Commands, Shortcuts, Tips Upgrade Ubuntu 24.04 to Ubuntu 26.04 LTS (Step by Step) Ubuntu Upgrade Ubuntu 24.04 to Ubuntu 26.04 LTS (Step by Step) Create Bootable Windows USB and Install Windows 11 Windows Create Bootable Windows USB and Install Windows 11 Manage openSUSE Leap with Cockpit: the YaST Replacement Linux Manage openSUSE Leap with Cockpit: the YaST Replacement openSUSE Leap vs Tumbleweed vs SLES: Which to Choose Linux openSUSE Leap vs Tumbleweed vs SLES: Which to Choose How To Upgrade VMware vCloud Usage Meter Virtualization How To Upgrade VMware vCloud Usage Meter

Leave a Comment

Press ESC to close