{"id":168913,"date":"2026-06-17T23:46:08","date_gmt":"2026-06-17T20:46:08","guid":{"rendered":"https:\/\/computingforgeeks.com\/?p=168913"},"modified":"2026-06-17T23:46:08","modified_gmt":"2026-06-17T20:46:08","slug":"zypper-command-cheat-sheet","status":"publish","type":"post","link":"https:\/\/computingforgeeks.com\/zypper-command-cheat-sheet\/","title":{"rendered":"zypper Command Cheat Sheet for openSUSE Leap"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">If you came to openSUSE from Debian or Fedora, the command that catches you out is the upgrade one. On Leap, <code>zypper dup<\/code> 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.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">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.<\/p>\n\n\n\n<div style=\"border:1px solid #d6dee6;border-left:4px solid #10b981;border-radius:8px;background:#f8fafc;padding:16px 18px;margin:10px 0 6px;\">\n<div style=\"font-weight:700;font-size:1.08em;color:#0f172a;\">Grab the printable zypper cheat sheet<\/div>\n<p style=\"margin:6px 0 12px;color:#475569;\">A one-page PDF with every command on this page, grouped by task. Free to print and pin above your desk.<\/p>\n<a href=\"https:\/\/computingforgeeks.com\/wp-content\/uploads\/2026\/06\/zypper-command-cheat-sheet.pdf\" target=\"_blank\" rel=\"noopener\" style=\"display:inline-block;background:#0f172a;color:#fff;text-decoration:none;font-weight:600;padding:9px 18px;border-radius:6px;\">Download the PDF cheat sheet<\/a>\n<\/div>\n\n\n\n<nav aria-label=\"On this page\" style=\"border:1px solid #e2e8f0;border-radius:8px;padding:12px 16px;margin:14px 0;font-size:0.95em;line-height:1.9;\">\n<strong style=\"display:block;margin-bottom:4px;color:#0f172a;\">On this page:<\/strong>\n<a href=\"#quick-reference\">Quick reference tables<\/a> &middot; <a href=\"#update-upgrade\">up vs patch vs dup<\/a> &middot; <a href=\"#install-search\">Install &amp; search<\/a> &middot; <a href=\"#repos\">Repositories<\/a> &middot; <a href=\"#release-upgrade\">Leap 15 to 16<\/a> &middot; <a href=\"#maintenance\">Locks &amp; cleanup<\/a>\n<\/nav>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"quick-reference\">zypper Cheat Sheet (Quick Reference)<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Run write operations (install, remove, repo changes, upgrades) with <code>sudo<\/code>. Read operations (search, info, list) work as a normal user. Most subcommands have a short alias, shown in parentheses below.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Update and upgrade<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Command<\/th><th>What it does<\/th><\/tr><\/thead><tbody>\n<tr><td><code>zypper ref<\/code><\/td><td>Refresh repository metadata (alias: <code>ref<\/code>)<\/td><\/tr>\n<tr><td><code>zypper up<\/code><\/td><td>Update installed packages to newer versions<\/td><\/tr>\n<tr><td><code>zypper lu<\/code><\/td><td>List available updates without installing<\/td><\/tr>\n<tr><td><code>zypper patch<\/code><\/td><td>Apply official maintenance patches (security and bugfix)<\/td><\/tr>\n<tr><td><code>zypper patch-check<\/code><\/td><td>Count needed patches and security patches<\/td><\/tr>\n<tr><td><code>zypper dup<\/code><\/td><td>Distribution upgrade, for release jumps and vendor changes<\/td><\/tr>\n<\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Install and remove<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Command<\/th><th>What it does<\/th><\/tr><\/thead><tbody>\n<tr><td><code>zypper in nginx<\/code><\/td><td>Install one or more packages (alias: <code>in<\/code>)<\/td><\/tr>\n<tr><td><code>zypper in -y nginx<\/code><\/td><td>Install without the confirmation prompt<\/td><\/tr>\n<tr><td><code>zypper rm nginx<\/code><\/td><td>Remove a package (alias: <code>rm<\/code>)<\/td><\/tr>\n<tr><td><code>zypper rm -u nginx<\/code><\/td><td>Remove a package and its now-unused dependencies<\/td><\/tr>\n<tr><td><code>zypper in --from packman ffmpeg<\/code><\/td><td>Install from one specific repository<\/td><\/tr>\n<tr><td><code>zypper install-new-recommends<\/code><\/td><td>Pull newly recommended packages (e.g. after adding NVIDIA)<\/td><\/tr>\n<\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Search and inspect<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Command<\/th><th>What it does<\/th><\/tr><\/thead><tbody>\n<tr><td><code>zypper se vim<\/code><\/td><td>Search package names and summaries (alias: <code>se<\/code>)<\/td><\/tr>\n<tr><td><code>zypper se -s vim<\/code><\/td><td>Search showing version, arch, and repo<\/td><\/tr>\n<tr><td><code>zypper se --provides \/usr\/bin\/dig<\/code><\/td><td>Find which package provides a file or capability<\/td><\/tr>\n<tr><td><code>zypper if zypper<\/code><\/td><td>Show package info: version, repo, size (alias: <code>if<\/code>)<\/td><\/tr>\n<tr><td><code>zypper pt<\/code><\/td><td>List available patterns (package groups)<\/td><\/tr>\n<tr><td><code>zypper in -t pattern devel_basis<\/code><\/td><td>Install a whole pattern at once<\/td><\/tr>\n<\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Repository management<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Command<\/th><th>What it does<\/th><\/tr><\/thead><tbody>\n<tr><td><code>zypper lr<\/code><\/td><td>List configured repositories (alias: <code>lr<\/code>)<\/td><\/tr>\n<tr><td><code>zypper lr -u<\/code><\/td><td>List repositories with their URIs<\/td><\/tr>\n<tr><td><code>zypper ar URL alias<\/code><\/td><td>Add a repository (alias: <code>ar<\/code>)<\/td><\/tr>\n<tr><td><code>zypper mr -d alias<\/code><\/td><td>Disable a repository<\/td><\/tr>\n<tr><td><code>zypper mr -e alias<\/code><\/td><td>Enable a repository<\/td><\/tr>\n<tr><td><code>zypper rr alias<\/code><\/td><td>Remove a repository (alias: <code>rr<\/code>)<\/td><\/tr>\n<\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Locks and cleanup<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Command<\/th><th>What it does<\/th><\/tr><\/thead><tbody>\n<tr><td><code>zypper al docker<\/code><\/td><td>Add a lock to hold a package at its current version<\/td><\/tr>\n<tr><td><code>zypper ll<\/code><\/td><td>List active package locks<\/td><\/tr>\n<tr><td><code>zypper rl docker<\/code><\/td><td>Remove a package lock<\/td><\/tr>\n<tr><td><code>zypper ps -s<\/code><\/td><td>Show services that need restarting after updates<\/td><\/tr>\n<tr><td><code>zypper clean -a<\/code><\/td><td>Clear cached metadata and downloaded packages<\/td><\/tr>\n<tr><td><code>zypper purge-kernels<\/code><\/td><td>Remove old kernels per the multiversion policy<\/td><\/tr>\n<\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Release upgrade (Leap 15 to 16)<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Command<\/th><th>What it does<\/th><\/tr><\/thead><tbody>\n<tr><td><code>sudo opensuse-migration-tool<\/code><\/td><td>Guided 15.6 to 16 migration (the supported path)<\/td><\/tr>\n<tr><td><code>sudo zypper --releasever 16.0 ref<\/code><\/td><td>Point repository metadata at the 16.0 release<\/td><\/tr>\n<tr><td><code>sudo zypper --releasever 16.0 dup --allow-vendor-change<\/code><\/td><td>Manual release upgrade<\/td><\/tr>\n<tr><td><code>sudo zypper dup --from packman --allow-vendor-change<\/code><\/td><td>Switch multimedia packages to Packman<\/td><\/tr>\n<\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"update-upgrade\">zypper up vs patch vs dup: the one thing to get right<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This is where people coming from Arch or Tumbleweed get burned. On Leap, the three update commands are not interchangeable.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>zypper patch<\/strong> 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:<\/p>\n\n\n\n<pre class=\"wp-block-code code\"><code>sudo zypper patch-check<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The output tells you exactly how many patches are waiting and how many are security-related:<\/p>\n\n\n\n<pre class=\"wp-block-code code\"><code>Loading repository data...\nReading installed packages...\n\n0 patches needed (0 security patches)<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>zypper up<\/strong> 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 <code>patch<\/code> for most updates, but <code>patch<\/code> is the one SUSE tooling and documentation treats as canonical, because it respects patch categories and reboot flags. Use <code>up<\/code> when you want every newer package, not just the ones bundled into a patch.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>zypper dup<\/strong> 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 <code>dup<\/code> every day. On Leap you do <strong>not<\/strong> 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 <code>dup<\/code> on Leap with a third-party repo enabled is the fastest way to pull in surprise vendor changes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The short rule: <code>patch<\/code> to stay current and secure, <code>up<\/code> to pull newer versions, <code>dup<\/code> only for release upgrades and deliberate repo switches.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"install-search\">Install, remove, and search packages<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Search before you install. The plain <code>se<\/code> matches names and summaries:<\/p>\n\n\n\n<pre class=\"wp-block-code code\"><code>zypper se vim<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Each match shows the status column on the left (a leading <code>i<\/code> means already installed), the name, a summary, and the type:<\/p>\n\n\n\n<pre class=\"wp-block-code code\"><code>S  | Name               | Summary                                | Type\n---+--------------------+----------------------------------------+--------\n   | gvim               | A GUI for Vi                           | package\n   | neovim             | Vim-fork focused on extensibility      | package\n   | meson-vim          | Vim syntax highlighting for meson      | package<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Add <code>-s<\/code> 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 <code>if<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code code\"><code>zypper if zypper<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">It prints the installed version, source repo, size, and a description, so you can confirm where a package would come from:<\/p>\n\n\n\n<pre class=\"wp-block-code code\"><code>Information for package zypper:\n-------------------------------\nRepository     : repo-oss (16.0)\nName           : zypper\nVersion        : 1.14.95-160000.1.1\nArch           : x86_64\nVendor         : SUSE LLC &lt;https:\/\/www.suse.com\/&gt;\nInstalled Size : 7.4 MiB\nInstalled      : Yes (automatically)\nStatus         : up-to-date<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Install with <code>in<\/code>, remove with <code>rm<\/code>. Adding <code>-u<\/code> on removal cleans up dependencies that nothing else needs anymore. For whole environments rather than single packages, install a pattern: <code>sudo zypper in -t pattern devel_basis<\/code> pulls the full build toolchain in one shot. List the available patterns with <code>zypper pt<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"repos\">Manage repositories on Leap 16<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">List what you have, with URIs, so you can see exactly where packages resolve from:<\/p>\n\n\n\n<pre class=\"wp-block-code code\"><code>zypper lr -u<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">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 <code>openSUSE:repo-non-oss<\/code>, not the bare <code>repo-non-oss<\/code> that older guides reference. Use the full alias in any command that names it:<\/p>\n\n\n\n<pre class=\"wp-block-code code\"><code># | Alias                   | Name                | Enabled | Refresh | URI\n--+-------------------------+---------------------+---------+---------+--------------------------------------------------\n2 | openSUSE:repo-non-oss   | repo-non-oss (16.0) | Yes     | Yes     | http:\/\/cdn.opensuse.org\/distribution\/leap\/16.0\/repo\/non-oss\/x86_64\n4 | openSUSE:repo-openh264  | repo-openh264       | Yes     | Yes     | https:\/\/codecs.opensuse.org\/openh264\/openSUSE_Leap_16\n5 | openSUSE:repo-oss       | repo-oss (16.0)     | Yes     | Yes     | http:\/\/cdn.opensuse.org\/distribution\/leap\/16.0\/repo\/oss\/x86_64<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Add a third-party repo with <code>ar<\/code>, giving it a URL and a short alias. Packman, the community multimedia repo, is the most common addition:<\/p>\n\n\n\n<pre class=\"wp-block-code code\"><code>sudo zypper ar -cfp 90 https:\/\/ftp.gwdg.de\/pub\/linux\/misc\/packman\/suse\/openSUSE_Leap_16.0\/ packman<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The flags earn their place: <code>-c<\/code> probes that the URI is a valid repo, <code>-f<\/code> turns on autorefresh, and <code>-p 90<\/code> 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 <code>mr -e<\/code> and <code>mr -d<\/code>, refresh a single repo with <code>zypper ref packman<\/code>, and drop one entirely with <code>rr<\/code>. The full codec and Packman walkthrough lives in the <a href=\"https:\/\/computingforgeeks.com\/things-to-do-after-installing-opensuse-leap\/\">post-install guide<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"release-upgrade\">Upgrade Leap 15 to Leap 16 with zypper<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">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 <code>dup<\/code>. Make sure 15.6 is fully patched and snapshotted first, then run:<\/p>\n\n\n\n<pre class=\"wp-block-code code\"><code>sudo zypper install opensuse-migration-tool\nsudo opensuse-migration-tool<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">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:<\/p>\n\n\n\n<pre class=\"wp-block-code code\"><code>sudo zypper --releasever 16.0 ref\nsudo zypper --releasever 16.0 dup --allow-vendor-change --download-in-advance<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This is one of the few times a <code>dup<\/code> belongs on Leap. The full tested walkthrough, including the post-migration SELinux switch and the repo checklist, is in the <a href=\"https:\/\/computingforgeeks.com\/upgrade-opensuse-leap-15-to-16\/\">Leap 15 to 16 upgrade guide<\/a>. Starting clean instead? See the <a href=\"https:\/\/computingforgeeks.com\/install-opensuse-leap-16\/\">Leap 16 install guide<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"maintenance\">Locks, reboot checks, and cleanup<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">After any sizeable update, ask whether a restart is actually needed instead of guessing:<\/p>\n\n\n\n<pre class=\"wp-block-code code\"><code>sudo zypper ps -s<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">It lists running processes using files that have since been updated, and tells you plainly when a reboot is unnecessary:<\/p>\n\n\n\n<pre class=\"wp-block-code code\"><code>No processes using deleted files found.\n\nNo core libraries or services have been updated since the last system boot.\nReboot is probably not necessary.<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">To pin a package at its current version (handy for Docker or a kernel module you do not want bumped), add a lock with <code>zypper al docker<\/code>, review locks with <code>zypper ll<\/code>, and lift one with <code>zypper rl docker<\/code>. When disk space gets tight, <code>sudo zypper clean -a<\/code> clears the metadata and download caches, and <code>sudo zypper purge-kernels<\/code> trims old kernels according to the multiversion policy. Pair these with <a href=\"https:\/\/computingforgeeks.com\/btrfs-snapshots-snapper-automatic-rollback-fedora-opensuse\/\">Snapper snapshots and rollback<\/a> and you can update aggressively without fear.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Pick the right command and move on<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If you remember nothing else: <code>zypper patch<\/code> for routine security and bugfix updates, <code>zypper in<\/code> and <code>zypper rm<\/code> for packages, <code>zypper lr<\/code> and <code>zypper ar<\/code> for repos, and <code>dup<\/code> 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 <a href=\"https:\/\/computingforgeeks.com\/what-is-new-in-opensuse-leap-16\/\">what changed in Leap 16<\/a> if a command behaves differently than it did on 15.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 &#8230; <a title=\"zypper Command Cheat Sheet for openSUSE Leap\" class=\"read-more\" href=\"https:\/\/computingforgeeks.com\/zypper-command-cheat-sheet\/\" aria-label=\"Read more about zypper Command Cheat Sheet for openSUSE Leap\">Read more<\/a><\/p>\n","protected":false},"author":17,"featured_media":168912,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[299,47,50],"tags":[282,9986],"cfg_series":[39887],"class_list":["post-168913","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-how-to","category-linux","category-linux-tutorials","tag-linux","tag-opensuse","cfg_series-opensuse-leap-16"],"_links":{"self":[{"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/posts\/168913","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/users\/17"}],"replies":[{"embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/comments?post=168913"}],"version-history":[{"count":3,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/posts\/168913\/revisions"}],"predecessor-version":[{"id":168990,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/posts\/168913\/revisions\/168990"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/media\/168912"}],"wp:attachment":[{"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/media?parent=168913"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/categories?post=168913"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/tags?post=168913"},{"taxonomy":"cfg_series","embeddable":true,"href":"https:\/\/computingforgeeks.com\/wp-json\/wp\/v2\/cfg_series?post=168913"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}