Zypper Package Manager Cheatsheet

A photograph of a person using a laptop.

Zypper is the default package manager for openSUSE distributions and SUSE Linux Enterprise Servers. It differs from APT and DNF package managers, as it employs SAT solver, one of the best package dependency libraries. This Zypper cheat sheet covers the main zypper commands, segmented into various categories.

Zypper Package Manager Cheatsheet Download

Download this Cheatsheet

Enter your email below to receive this PDF cheatsheet in your Inbox.

CommandFunction
Basic Help
zypper #Show all available global commands and options.
zypper help [command]Displays help for the specified command.
zypper shellStarts a shell session.
Repository Management
zypper addrepo [repo url alias]Add a new repository with the specified repo URL.
zypper info [package]Show information about a specified package.
zypper namerepoUsed to rename a repository alias. For example, to rename repo from “sample” to “sample.repo”:
zypper namerepo sample sample.repo.
zypper modifyrepoModify a repo by either enabling or disabling it. Use the repository unique value from the zypper lr command.
zypper removerepoRemove a specified repo. For example: zypper removerepo repo-non-oss.
zypper refresh [repo alias]Refresh the specified repository. For example: zypper refresh repo-oss.
zypper refresh [repo alias]Refresh the specified repository. For example: zypper refresh repo-oss.
zypper reposShow the available repositories, including alias and source URI.
zypper cleanClean a specified repository. For example: zypper clean repo-oss.
zypper repos -e [repo-name][destination]Export the specified repository from a set source to destination.
zypper repos -ar [repo-name] [src]Import a repository from specified source.
Service Management
zypper servicesShow the repository’s defined services.
zypper addservice [service-name]Add a service with the specified name.
zypper modifyservice [service-name]Modify the specified service.
zypper refresh serviceRefresh all the available services.
zypper removeservice [service name]Remove the specified service.
Package Installation
zypper install [package]Install the latest version of the specified package.
zypper install -D [package]Simulate the installation of the specific package.
zypper install -r [repo] [package]Install the latest version of the specified package from a custom repository.
zypper install -l [package]Automatically agree to all non-free licenses when installing a specific package.
zypper install –no-recommends [package]Install the latest version of the specified package but do not install any optional packages.
zypper install-new-recommends [package]Install the latest version of any optional packages for the specified package.
zypper install –oldpackage [package]Install an older version of the specified package.
Package Removal
zypper remove [package]Remove the installed version of the specified package.
zypper remove -D [package]Simulate the removal of a specific package.
zypper remove -u [package]Remove the installed version of the specified package as well as any unused dependencies.
zypper remove -U [package]Remove the installed version of the specified package but do not remove any unused dependencies.
zypper remove -C [feature]Remove any packages that provide a particular system feature.
zypper remove -n [package]Remove any packages if it matches the current query.
Package Verification
zypper verifyVerify the integrity of package dependencies. Useful when you have broken packages.
zypper verify –no-recommendsVerify the integrity of package dependencies but do not modify and install any additional packages in the system.
Source Package Management
zypper source-installInstall source packages and build dependencies.
zypper source-install -DInstall the source packages without any build dependencies.
zypper source-install -dInstall the build dependencies for a particular source package.
zypper source-install –download-onlyDownload both the source file and its dependencies to your machine.
Package Updates
zypper updateUpdate the specified packages.
zypper update -lAutomatically agree to all non-free software licenses while updating the system.
zypper update -r [repo]Update the current system using packages from a custom repository.
zypper update –skip-interactiveUpdate the current system and omit any package update that requires any user intervention.
zypper update –with-interactiveUpdate the current system and forcefully update any packages that require user intervention.
zypper update –replacefilesUpdate the current system and skip potential file conflicts by allowing Zypper to overwrite existing packages.
zypper update -DSimulate a full system update.
Package Patching
zypper list-patchesList all the available patches for all the currently installed packages.
zypper list-patches -bList all the available Bugzilla patches for all currently installed packages.
zypper list-patches –cveList all the available MITRE’s CVE patches for all currently installed packages.
zypper patch-checkList all the applicable patches for the system.
zypper patchInstall all the applicable patches for the system.
zypper patch -b [patch number]Install a specific Bugzilla patch for the system.
zypper patch –cve [patch number] Install a specific MITRE’s CVE patch for the system.
Package Information and Search
zypper search [package-name]Search for a package. For example, zypper se nginx.
zypper search –match-exact [package name]Do an exact word search on the current query.
zypper search –requires [package name]Search for all the packages that requires the current query as part of their dependency list.
zypper search –recommends [package name]Search for all the packages that the current query includes as its optional dependencies.
zypper search –conflicts [package name]Search for all the packages that conflicts with the current query.
zypper info [package-name]Display detailed information about the specified package.
Distribution Upgrade
zypper dist-upgradePerform a distribution upgrade for all installed packages. It is best to restrict upgrade from a specific source repo.
zypper dist-upgrade -DSimulate a distribution upgrade for all installed packages.

Image credit: Unsplash (Background) and Wikimedia Commons (Logo). All alterations by Ramces Red.

Is this post useful?
Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox

Ramces Red
Ramces Red - Staff Writer

Ramces is a technology writer that lived with computers all his life. A prolific reader and a student of Anthropology, he is an eccentric character that writes articles about Linux and anything *nix.