Update and upgrade
zypper lu
List available updates
sudo zypper up
Update all installed packages
sudo zypper up <pkg>
Update one package
sudo zypper dup
Distribution upgrade (full sync)
Tumbleweed: this is the normal update. It may change vendors
and remove packages, so read the summary.
sudo zypper dup --from <repo>
Upgrade only from a given repo
sudo zypper dup --releasever <ver>
Switch release during upgrade
Point the repos at the new release first (check with zypper
--releasever <ver> lr -u), then refresh and run dup.
zypper lp
List needed patches
zypper pchk
Exit 100/101 if patches pending
100 means patches are available, 101 means security patches
are available.
sudo zypper patch
Apply all needed patches
On SUSE Linux Enterprise this is the usual update path;
Tumbleweed has no patches.
sudo zypper patch --category security
Only security patches
zypper lp --cve=<CVE-ID>
Patches for a CVE
sudo zypper up -D
Dry run, change nothing
sudo zypper -n up
No prompts, for scripts
Install and remove
sudo zypper in <pkg>
Install a package
sudo zypper in <pkg1> <pkg2>
Install several at once
sudo zypper in -y <pkg>
Install without asking
sudo zypper in --no-recommends <pkg>
Skip recommended extras
sudo zypper in -r <repo> <pkg>
Install from one repo
sudo zypper in <name>=<ver>
Install a specific version
sudo zypper in -f <pkg>
Reinstall a package
sudo zypper in <file>.rpm
Install a local RPM
sudo zypper in -D <pkg>
Dry run the install
sudo zypper in -t pattern <name>
Install a pattern
sudo zypper rm <pkg>
Remove a package
sudo zypper rm -u <pkg>
Remove with unused dependencies
sudo zypper si <pkg>
Install source build deps and sources
sudo zypper ve
Verify and repair dependencies
sudo zypper purge-kernels
Remove old kernels
Keeps the kernels set in multiversion.kernels in
/etc/zypp/zypp.conf.
Repositories
zypper lr
List repositories
zypper lr -d
Repos with URI, priority, refresh
zypper lr -E
Enabled repos only
sudo zypper ar -f <url> <alias>
Add a repo with autorefresh
sudo zypper ar -p <n> <url> <alias>
Add repo with priority
1 is highest, 99 the default; a lower number wins when
versions compete.
sudo zypper ar <file>.repo
Add repos from a .repo file
sudo zypper rr <alias>
Remove a repository
sudo zypper mr -d <alias>
Disable a repository
sudo zypper mr -e <alias>
Enable a repository
sudo zypper mr -p <n> <alias>
Change repo priority
sudo zypper mr -f <alias>
Turn on autorefresh
sudo zypper ref
Refresh all repos
sudo zypper ref -f
Force a full refresh
sudo zypper --gpg-auto-import-keys ref
Trust new repo keys
sudo zypper clean -a
Clear caches
zypper lr -e <file>.repo
Export repos to a file