Linux zypper Command: Manage Packages on openSUSE and SUSE

zypper performs package searching, installation, removal, repository refresh, and system updates on openSUSE and SUSE Linux Enterprise. The correct update command should be chosen according to the release method of the distribution.

What is the zypper command?

refresh retrieves the repository metadata anew, install installs packages and necessary dependencies. update and dup (distribution upgrade) cover different scopes, so check the instructions for the respective products such as openSUSE Leap or Tumbleweed. Review the proposed installation and removal items before executing a command.

Basic syntax

zypper [global-options] command [arguments...]

The installed implementations and options may vary depending on the distribution. Use man zypper to check the description on the current system.

Examples

Refreshing repository metadata

Fetches the package information of the configured repositories anew.

sudo zypper refresh

Package search

Checks the candidate packages and repositories.

zypper search nginx

Package Installation

Proceed after checking that there are no unresolved dependencies or packages to be removed.

sudo zypper install nginx

Checking Installation Candidates and Repositories

zypper info shows the installation status, version, repository, description, and other information of packages on openSUSE and SUSE systems.

zypper info bash

Format of items that can be checked in the output:

Information for package bash:
Repository : ...
Name       : bash
Version    : ...
Installed  : Yes

The display language and field names vary depending on your system settings. Do not confuse zypper refresh, which updates repository metadata, with zypper update, which installs updates. Since adding repositories or changing priorities can change the installation candidate, check the package source before applying.

Main Options and Format

Options/Format Description
refresh Update the repository metadata.
search / info Find a package or view information.
install / remove Install or remove packages.
update / dup Perform updates or distribution upgrades according to the selected release policy.
repos Display the list of configured repositories.

Precautions when using

In particular, do not run zypper dup carelessly like a simple update command, as it can affect repositories and release transitions. The recommended update flow may differ between Tumbleweed and Leap. When mixing third-party repositories, carefully check the suggestions for provider changes and package removals.

Frequently Asked Questions

Will the program be updated by just running zypper refresh?

No. Refresh updates the repository information. Actual package changes require commands like update or dup appropriate for the distribution.

Official Documentation

The exact behavior of the options and implementation-specific differences can be found in the official zypper documentation.

More in This Category
Linux sort Command: Sort Text Lines

Linux sort Command: Sort Text Lines

Learn how to sort text lines with the Linux sort command, including practical examples, key options, and important precautions.

Linux modinfo Command: Inspect Kernel Module Details

Linux modinfo Command: Inspect Kernel Module Details

Learn how to inspect Kernel Module Details with the Linux modinfo command, including practical examples, key options, and important precautions.

Linux whoami Command: Show the Effective User Name

Linux whoami Command: Show the Effective User Name

Learn how to show the Effective User Name with the Linux whoami command, including practical examples, key options, and important precautions.

Linux nc Command: Test TCP and UDP Connections

Linux nc Command: Test TCP and UDP Connections

Learn how to test TCP and UDP Connections with the Linux nc command, including practical examples, key options, and important precautions.

Linux env Command: Display Variables and Run Commands with a Custom Environment

Linux env Command: Display Variables and Run Commands with a Custom Environment

Learn how to use the Linux env command to display environment variables or run a command with temporary variable values, with essential options, practical examples, output interpretation, and common troubleshooting tips.

Linux Directory Structure Explained: Purpose of Major Directories

Linux Directory Structure Explained: Purpose of Major Directories

Understand the purpose of major Linux directories such as /etc, /var, /usr, /home, /proc, and /sys, and learn where common system files belong.

Linux printenv Command: Print Environment Variable Values

Linux printenv Command: Print Environment Variable Values

Learn how to use the Linux printenv command to print all environment variables or selected variable values, with essential options, practical examples, output interpretation, and common troubleshooting tips.

Linux Tutorial / What Is Linux? Understanding the Kernel, Distributions, and Open Source

Linux Tutorial / What Is Linux? Understanding the Kernel, Distributions, and Open Source

Understand how the Linux kernel differs from a distribution, what user space and open source mean, and how to check your system's kernel and distribution versions.

Linux nmap Command: Scan Authorized Hosts and Ports

Linux nmap Command: Scan Authorized Hosts and Ports

Learn how to scan Authorized Hosts and Ports with the Linux nmap command, including practical examples, key options, and important precautions.

Linux groups Command: Show a User's Group Memberships

Linux groups Command: Show a User's Group Memberships

Learn how to show a User's Group Memberships with the Linux groups command, including practical examples, key options, and important precautions.