Zypper Package Manager Cheatsheet Without Punctuations For Easy Reference

Zypper is a powerful command-line package manager for openSUSE and SUSE Linux Enterprise distributions, known for its efficiency and robust dependency management. Here is a comprehensive cheatsheet to help you effectively use Zypper.

Package Installation

  • Install a Package: zypper install [package] – Installs the latest version of the specified package.
    • Example: zypper install git
  • Simulate Installation: zypper install -D [package] – Simulates the installation of the specific package.
    • Example: zypper install -D git
  • Install from Custom Repository: zypper install -r [repo] [package] – Installs the latest version of the specified package from a custom repository.
    • Example: zypper install -r factory git
  • Auto-Agree with Licenses: zypper install -l [package] – Automatically agrees to all non-free licenses when installing a specific package.
    • Example: zypper install -l git
  • Install Without Optional Packages: zypper install --no-recommends [package] – Installs the latest version of the specified package but does not install any optional packages.
    • Example: zypper install --no-recommends git
  • Install Older Version: zypper install --oldpackage [package] – Installs an older version of the specified package.
    • Example: zypper install --oldpackage git

Package Removal

  • Remove a Package: zypper remove [package] or zypper rm [package] – Removes the installed version of the specified package.
    • Example: zypper remove git
  • Simulate Removal: zypper remove -D [package] – Simulates the removal of a specific package.
    • Example: zypper remove -D git
  • Remove Unused Dependencies: zypper remove -u [package] – Removes the installed version of the specified package as well as any unused dependencies.
    • Example: zypper remove -u git
  • Remove Without Unused Dependencies: zypper remove -U [package] – Removes the installed version of the specified package but does not remove any unused dependencies.
    • Example: zypper remove -U git

Package Updates

  • Update All Packages: zypper update or zypper up – Updates all installed packages to the latest version.
    • Example: zypper update
  • Update Specific Packages: zypper update [package] – Updates specific packages to the latest version.
    • Example: zypper update git
  • Update from Custom Repository: zypper update -r [repo] – Updates the current system using packages from a custom repository.
    • Example: zypper update -r factory
  • Auto-Agree with Licenses During Update: zypper update -l – Automatically agrees to all non-free software licenses while updating the system.
    • Example: zypper update -l
  • Non-Interactive Update: zypper update --skip-interactive – Updates the current system and omits any package update that requires user intervention.
    • Example: zypper update --skip-interactive

Repository Management

  • List Repositories: zypper repos or zypper lr – Lists all defined repositories.
    • Example: zypper lr
  • Add Repository: zypper addrepo [URL] [alias] or zypper ar [URL] [alias] – Adds a new repository.
    • Example: zypper ar http://download.opensuse.org/update/11.1/ update
  • Remove Repository: zypper removerepo [name] or zypper rr [name] – Removes a specified repository.
    • Example: zypper rr update
  • Refresh Repositories: zypper refresh or zypper ref – Refreshes the repository data.
    • Example: zypper ref
  • Modify Repository: zypper modifyrepo [options] or zypper mr [options] – Modifies repository settings such as enabling or disabling autorefresh and setting priorities.
    • Example: zypper mr -d 6 – Disables repository #6

Package Verification

  • Verify Package Dependencies: zypper verify – Verifies the integrity of package dependencies, useful when you have broken packages.
    • Example: zypper verify
  • Verify Without Additional Packages: zypper verify --no-recommends – Verifies the integrity of package dependencies but does not modify and install any additional packages.
    • Example: zypper verify --no-recommends

Source Package Management

  • Install Source Packages: zypper source-install [package] or zypper si [package] – Installs source packages and build dependencies.
    • Example: zypper si git
  • Install Source Package Without Build Dependencies: zypper source-install -D [package] – Installs the source package without any build dependencies.
    • Example: zypper si -D git
  • Install Build Dependencies: zypper source-install -d [package] – Installs the build dependencies for a particular source package.
    • Example: zypper si -d git
  • Download Source Package and Dependencies: zypper source-install --download-only [package] – Downloads both the source file and its dependencies to your machine.
    • Example: zypper si --download-only git

Global Options

  • Non-Interactive Mode: zypper --non-interactive – Runs the command without asking for user confirmation, using default answers.
    • Example: zypper --non-interactive patch
  • Auto-Agree with Licenses: zypper --auto-agree-with-licenses – Automatically agrees to all licenses without prompting the user.
    • Example: zypper --auto-agree-with-licenses patch
  • Quiet Output: zypper --quiet – Suppresses most of the output, making it useful for scripting.
    • Example: zypper --quiet patch
  • XML Output: zypper --xmlout – Outputs the result in XML format, useful for parsing by scripts.
    • Example: zypper --xmlout patch

Zypper Shell

  • Open Zypper Shell: zypper shell or zypper sh – Opens a Zypper shell session where you can execute multiple commands interactively.
    • Example: zypper sh
    • Usage: Once in the shell, type help to get a list of global options and commands.

Help and Information

  • General Help: zypper – Lists the available global options and commands.
    • Example: zypper
  • Help for Specific Command: zypper help [command] – Prints help for a specific command.
    • Example: zypper help install
  • List Installed Packages: zypper search -is – Lists all installed packages.
    • Example: zypper search -is
  • Show Package Information: zypper info [package] – Displays detailed information about a package.
    • Example: zypper info git

Leave a Reply

Your email address will not be published. Required fields are marked *