Operations 5 min read

Mastering Zypper: Essential Commands for SUSE Linux Package Management

This guide walks through the core Zypper commands on openSUSE Leap 15.2, showing how to list global options, get help, list and refresh repositories, install, remove, update, search, view package info, and clean caches, with concrete command syntax and example outputs.

Liangxu Linux
Liangxu Linux
Liangxu Linux
Mastering Zypper: Essential Commands for SUSE Linux Package Management

Zypper is the package manager for SUSE Linux, used to install, update, remove software, manage repositories, and perform queries.

Example 1: List global options and commands

Run zypper to display all available global options and commands.

a3f8298a0fe2:/ # zypper

Example 2: Get help for a sub‑command

Use zypper help [subcommand]. For example:

a3f8298a0fe2:/ # zypper help remove

Example 3: List repositories

Show configured repositories with either zypper repos or its short form zypper lr:

a3f8298a0fe2:/ # zypper repos
or
a3f8298a0fe2:/ # zypper lr

Example 4: Refresh repository metadata

Refresh all repositories using zypper refresh or the short form zypper ref:

a3f8298a0fe2:/ # zypper ref

Example 5: Install software

Install a package with zypper install or zypper in. Adding -y answers prompts automatically:

a3f8298a0fe2:/ # zypper in -y vim

Example 6: Remove software

Remove a package using zypper remove or zypper rm, also supporting -y:

a3f8298a0fe2:/ # zypper rm -y vim

Example 7: Update packages

Update all packages with zypper update or zypper up. The -y flag can be added to skip confirmation:

a3f8298a0fe2:/ # zypper update -y zypper

Example 8: Search for packages

Search the repository using zypper search or zypper se:

a3f8298a0fe2:/ # zypper se gnome-desktop

Example 9: Show package details

Get detailed information with zypper info or zypper if:

a3f8298a0fe2:/ # zypper info apache2

Example 10: Clean Zypper cache

To clean only the cache, run:

a3f8298a0fe2:/ # zypper clean
All repositories have been cleaned up.

To clean both metadata and package caches, add the -a option:

a3f8298a0fe2:/ # zypper clean -a
All repositories have been cleaned up.

The article also includes screenshots illustrating each command’s output, which have been retained as image references.

Zypper command overview
Zypper command overview
Zypper output example
Zypper output example
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

openSUSEpackage-managementzyppersuse
Liangxu Linux
Written by

Liangxu Linux

Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.