LinuxCommandLibrary

zypper

Manage software packages on openSUSE and SLE

TLDR

Synchronize list of packages and versions available

$ zypper [[ref|refresh]]
copy

Install a new package
$ zypper [[in|install]] [package]
copy

Remove a package
$ zypper [[rm|remove]] [package]
copy

Upgrade installed packages to the newest available versions
$ zypper [[up|update]]
copy

Search package via keyword
$ zypper [[se|search]] [keyword]
copy

Show information related to configured repositories
$ zypper [[lr|repos]] --sort-by-priority
copy

SYNOPSIS

zypper [global-options] command [command-options] [arguments]

PARAMETERS

-v, --verbose
    Increase verbosity, showing more details about the operation.

-q, --quiet
    Suppress all non-essential output, only showing errors or direct results.

--non-interactive
    Do not ask any questions; assume 'yes' to all prompts or abort on error.

--root


    Operate on a different root directory instead of the default '/'. Useful for chroot environments.

--config
    Use a specific configuration file instead of the default '/etc/zypp/zypp.conf'.

--gpg-auto-import-keys
    Automatically import new GPG keys that zypper encounters, without asking for confirmation.

--no-confirm
    Used with commands like install or update to bypass confirmation prompts, proceeding automatically.

--download-only
    Used with install or update to only download packages without actually installing or updating them.

--dry-run
    Used with update or install to simulate the operation without making any actual changes to the system.

DESCRIPTION

zypper is the primary command-line interface for ZYpp (libzypp), the powerful package management engine used by openSUSE and SUSE Linux Enterprise. It provides a comprehensive set of functionalities for managing software packages, repositories, and system updates.

Users can easily install, update, remove, and query software packages, as well as manage external software repositories. zypper excels in handling complex dependency resolutions, ensuring system consistency and stability during package operations. Its transactional nature allows for reliable updates and offers features like rollbacks in conjunction with tools like snapper.

Beyond basic package management, zypper supports advanced features such as managing software update services, applying security patches, and performing distribution upgrades, making it an indispensable tool for both system administrators and general users on SUSE-based systems.

CAVEATS

Most zypper operations, especially those that modify the system (e.g., install, update, remove), require root privileges.
Dependency resolution can sometimes propose complex solutions; always review proposed changes before confirming them.
Network connectivity is essential for downloading packages from remote repositories, and firewall settings might interfere.
Large updates or systems with numerous repositories might experience slower performance during metadata refresh and dependency calculation.

IMPORTANT CONFIGURATION FILES

zypper's global behavior is configured primarily through the /etc/zypp/zypp.conf file, which contains various settings for package management. Repository definitions, which specify the locations of software sources, are stored as individual .repo files within the /etc/zypp/repos.d/ directory.

SERVICES AND PATCHES

Beyond individual package management, zypper offers advanced capabilities for managing software update services (e.g., connections to SUSE Customer Center for enterprise users) and applying patches. Patches are often curated collections of packages designed to fix bugs, address security vulnerabilities, or introduce specific enhancements. Commands like zypper patch and zypper services facilitate these operations.

HISTORY

zypper emerged as a core component of the ZYpp (libzypp) project, which was initiated by Novell/SUSE. The goal was to develop a modern, robust, and unified package management engine for their Linux distributions. It aimed to replace older, less integrated tools and provide a consistent command-line interface for both openSUSE and SUSE Linux Enterprise.

Since its initial introduction, zypper has become the de facto standard package manager for these distributions. It has continually evolved with performance improvements, new features, and tighter integration with underlying system technologies, notably including snapshot and rollback capabilities often provided by snapper.

SEE ALSO

rpm(8), man(1), yast(8), snapper(8), dnf(8), apt-get(8)

Copied to clipboard