Zypper cheat sheet

Zypper is the package manager of OpenSUSE and SUSE Linux. The basics are pretty easy to remember but sometimes a cheat sheet is just handy.

Package Management

zypper install (in)

Install or update a package by its name.

$ zypper in php7

Install a specific version of a package.

$ zypper in zypper=1.14.30

Install a pattern.

$ zypper in -t pattern xfce

zypper remove (rm)

Uninstall the selected and their dependent packages.

$ zypper rm php7

zypper info (if)

Displays detailed information about the specified packages.

$ zypper if php7

Show symbols the package requires.

$ zypper if --requires php7

zypper verify (ve)

Check whether dependencies of installed packages are satisfied.

$ zypper ve

Update Management

zypper update (up)

Update installed packages with newer versions.

$ zypper up

Update a specific package with a newer version.

$ zypper up php7

zypper list-updates (lu)

List installable updates.

$ zypper lu

zypper dist-upgrade (dup)

Perform a distribution upgrade.

$ zypper dup

Query Commands

zypper search (se)

Search for packages matching any of the given search strings.

$ zypper se mysql

Search using a wildcard.

$ zypper se 'yast*'

Search for packages that provide a specific binary.

$ zypper se --provides --match-exact npm

zypper packages (pa)

Show packages which are orphaned (without repository).

$ zypper pa --orphaned

Show packages which are unneeded.

$ zypper pa --unneeded

zypper patterns (pt)

List all available patterns or all patterns from specified repositories.

$ zypper pt

Repository Management

zypper addrepo (ar)

Add a new repository specified.

$ zypper ar

zypper removerepo (rr)

Delete repositories specified.

$ zypper rr

zypper repos (lr)

List all defined repositories.

$ zypper lr

zypper refresh (ref)

Refresh repositories specified by their alias, name, number, or URI.

$ zypper ref

zypper clean (cc)

Clean the local caches for all known or specified repositories.

$ zypper cc

Package Locks

zypper locks (ll)

List currently active package locks.

$ zypper ll

zypper addlock (al)

Add a package lock.

$ zypper al php7

zypper removelock (rl)

Remove specified package lock.

$ zypper rm php7

See Also

6 Non-Programming Books for Programmers