zypper module manages packages and repositories on openSUSE and SUSE Linux Enterprise systems.
Functions
packages
Install, remove, or update zypper packages.str | list[str]
List of packages to ensure.
bool
default:true
Whether the packages should be installed.
bool
default:false
Whether to upgrade packages without a specified version.
bool
default:false
Run
zypper update before installing packages.bool
default:false
Run
zypper clean --all before installing packages.str
Additional global arguments to the zypper install command.
str
Additional arguments to the zypper install command.
str
Additional global arguments to the zypper uninstall command.
str
Additional arguments to the zypper uninstall command.
Package versions can be pinned like zypper:
<pkg>=<version>Examples
update
Update all zypper packages.repo
Add, remove, or update zypper repositories.str
required
URL or name for the
.repo file.str
The baseurl of the repo (if
src is not a URL).bool
default:true
Whether the
.repo file should be present.str
Optional verbose description.
bool
default:true
Whether this repo is enabled.
bool
default:true
Whether to set
gpgcheck=1.str
The URL to the GPG key for this repo.
str
default:"rpm-md"
The type field for this repo.
baseurl, description, gpgcheck, and gpgkey are only valid when src is a filename (not a URL). Use a URL to download and install remote repository files.Examples
rpm
Install or remove .rpm package files.str
required
Filename or URL of the
.rpm package.bool
default:true
Whether the package should exist on the system.
key
Add zypper GPG keys with rpm.str
required
Filename or URL of the GPG key.
The
key operation is inherited from the yum module.Common Use Cases
Install Docker on openSUSE
Development Environment
Web Server Setup
System Update
Install from Custom Repository
openSUSE-Specific Tips
Patterns
Patterns
openSUSE uses patterns for installing groups of related packages:
Repository Management
Repository Management
List and manage repositories:
Package Locks
Package Locks
Lock packages to prevent updates:
Distribution Upgrade
Distribution Upgrade
Upgrade to a new openSUSE version:
Important Notes
Zypper automatically uses the
--non-interactive flag for all operations in pyinfra.