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 curl Command: Make URL Requests and Inspect HTTP Responses

Linux curl Command: Make URL Requests and Inspect HTTP Responses

Learn how to make URL Requests and Inspect HTTP Responses with the Linux curl command, including practical examples, key options, and important precautions.

Linux tracepath Command: Trace a Network Path and Path MTU

Linux tracepath Command: Trace a Network Path and Path MTU

Learn how to trace a Network Path and Path MTU with the Linux tracepath command, including practical examples, key options, and important precautions.

Linux zip Command: Create ZIP Archives

Linux zip Command: Create ZIP Archives

Learn how to create ZIP Archives with the Linux zip command, including practical examples, key options, and important precautions.

Linux traceroute Command: Trace Routers on the Way to a Host

Linux traceroute Command: Trace Routers on the Way to a Host

Learn how to trace Routers on the Way to a Host with the Linux traceroute command, including practical examples, key options, and important precautions.

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 install Command: Copy Files and Set Attributes

Linux install Command: Copy Files and Set Attributes

Learn how to use the Linux install command to copy files while setting modes, owners, groups, timestamps, and destination directories in deployment scripts.

Linux dmesg Command: Read Kernel and Boot Messages

Linux dmesg Command: Read Kernel and Boot Messages

Learn how to read Kernel and Boot Messages with the Linux dmesg command, including practical examples, key options, and important precautions.

Linux cp Command: Copy Files and Directories

Linux cp Command: Copy Files and Directories

Learn how to copy files and directories with Linux cp, control overwrites, preserve attributes, handle symlinks, and verify important copies.

Linux screen Command: Create and Manage Detachable Terminal Sessions

Linux screen Command: Create and Manage Detachable Terminal Sessions

Learn how to use the Linux screen command to keep terminal sessions running and reconnect to them later, with essential options, practical examples, output interpretation, and common troubleshooting tips.

Linux dnf Command: Manage RPM Distribution Packages

Linux dnf Command: Manage RPM Distribution Packages

Learn how to manage RPM Distribution Packages with the Linux dnf command, including practical examples, key options, and important precautions.