🧰 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 :

Leave a Reply

Your email address will not be published. Required fields are marked *

Share

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

Or Copy Link

CONTENTS
Scroll to Top