Linux/Unix: SUSE Package Management – zypper Command Explained with Examples

Introduction – Why Learn zypper on SUSE Linux?

If you use SUSE Linux Enterprise Server (SLES) or openSUSE, you’ll manage packages using zypperβ€”a powerful and script-friendly command-line interface to ZYpp, the package management engine. Whether updating software or handling repositories, zypper is fast, consistent, and great for automation.

In this guide, you’ll learn:

  • How to install, update, and remove software with zypper
  • How to manage repositories and patches
  • Real-world examples and outputs for each command

What is zypper?

zypper is the official package manager for SUSE-based systems, used to install RPM packages, manage repositories, update the system, and resolve dependencies automatically.

Syntax:

sudo zypper [command] [options]

Essential zypper Commands & Examples

1. Refresh Repositories

sudo zypper refresh

Output:

Repository 'Main Repository' is up to date.
All repositories have been refreshed.

Always run this before updates or installs.


2. Install a Package

sudo zypper install nginx

Output:

The following package is going to be installed:
  nginx
Continue? [y/n/v/...? shows all options] (y): y

Installs the latest available version with dependencies.


3. Remove a Package

sudo zypper remove nginx

Uninstalls the package cleanly, keeping shared dependencies.


4. Update All Installed Packages

sudo zypper update

Output:

Reading installed packages...
Nothing to do.

Equivalent to apt upgrade or dnf upgrade.


5. Search for a Package

zypper search git

Output:

S | Name        | Summary
--+-------------+------------------------------
i | git         | Distributed Version Control

i = installed, S = source package


6. View Package Info

zypper info git

Output:

Name           : git
Version        : 2.35.3
Summary        : Distributed Version Control System
Repository     : Main Repository

7. Clean Package Cache

sudo zypper clean

Frees up disk space by removing cached RPM files.


8. Add a New Repository

sudo zypper addrepo https://download.opensuse.org/repositories/network/openSUSE_Tumbleweed/network.repo

Use zypper repos to view all repositories.


zypper Flags Summary

CommandAction
installInstall a package
removeUninstall a package
updateUpdate installed packages
refreshRefresh repository metadata
searchSearch available packages
infoView package details
addrepoAdd new repository
cleanClear package cache
patchApply system patches

Tool Comparison Table

Featurezypper
System TypeopenSUSE, SLES
Format Support.rpm
Dependency Resolution Yes
Update All Packages zypper update
Repository Management zypper addrepo, repos
GUI Alternative YaST (Yet Another Setup Tool)

Summary – Recap & Next Steps

If you’re managing SUSE or openSUSE, zypper is your primary CLI tool for installing software, managing repositories, and keeping the system secure. It’s reliable, fast, and easily scriptable for automation and server deployment.

Key Takeaways:

  • Use zypper install and remove to manage software packages.
  • Use zypper refresh and update for system maintenance.
  • Use zypper repos, addrepo, and clean for repo and cache management.

FAQs

Can I install .rpm files manually with zypper?
Yes. Use:

sudo zypper install ./package.rpm

How do I fix broken dependencies?
Run:

sudo zypper verify

How do I update only a specific package?
Use:

sudo zypper update vim

Is there a GUI for zypper?
Yes. Use YaST, the graphical control center for SUSE systems.

How do I list installed packages?
Run:

zypper search --installed-only

Share Now :
Share

πŸ”΅ Linux/Unix: SUSE (zypper)

Or Copy Link

CONTENTS
Scroll to Top