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.









