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
- Example:
- Simulate Installation:
zypper install -D [package]
– Simulates the installation of the specific package.- Example:
zypper install -D git
- Example:
- 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
- Example:
- 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
- Example:
- 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
- Example:
- Install Older Version:
zypper install --oldpackage [package]
– Installs an older version of the specified package.- Example:
zypper install --oldpackage git
- Example:
Package Removal
- Remove a Package:
zypper remove [package]
orzypper rm [package]
– Removes the installed version of the specified package.- Example:
zypper remove git
- Example:
- Simulate Removal:
zypper remove -D [package]
– Simulates the removal of a specific package.- Example:
zypper remove -D git
- Example:
- 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
- Example:
- 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
- Example:
Package Updates
- Update All Packages:
zypper update
orzypper up
– Updates all installed packages to the latest version.- Example:
zypper update
- Example:
- Update Specific Packages:
zypper update [package]
– Updates specific packages to the latest version.- Example:
zypper update git
- Example:
- Update from Custom Repository:
zypper update -r [repo]
– Updates the current system using packages from a custom repository.- Example:
zypper update -r factory
- Example:
- 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
- Example:
- 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
- Example:
Repository Management
- List Repositories:
zypper repos
orzypper lr
– Lists all defined repositories.- Example:
zypper lr
- Example:
- Add Repository:
zypper addrepo [URL] [alias]
orzypper ar [URL] [alias]
– Adds a new repository.- Example:
zypper ar http://download.opensuse.org/update/11.1/ update
- Example:
- Remove Repository:
zypper removerepo [name]
orzypper rr [name]
– Removes a specified repository.- Example:
zypper rr update
- Example:
- Refresh Repositories:
zypper refresh
orzypper ref
– Refreshes the repository data.- Example:
zypper ref
- Example:
- Modify Repository:
zypper modifyrepo [options]
orzypper mr [options]
– Modifies repository settings such as enabling or disabling autorefresh and setting priorities.- Example:
zypper mr -d 6
– Disables repository #6
- Example:
Package Verification
- Verify Package Dependencies:
zypper verify
– Verifies the integrity of package dependencies, useful when you have broken packages.- Example:
zypper verify
- Example:
- 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
- Example:
Source Package Management
- Install Source Packages:
zypper source-install [package]
orzypper si [package]
– Installs source packages and build dependencies.- Example:
zypper si git
- Example:
- Install Source Package Without Build Dependencies:
zypper source-install -D [package]
– Installs the source package without any build dependencies.- Example:
zypper si -D git
- Example:
- Install Build Dependencies:
zypper source-install -d [package]
– Installs the build dependencies for a particular source package.- Example:
zypper si -d git
- Example:
- 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
- Example:
Global Options
- Non-Interactive Mode:
zypper --non-interactive
– Runs the command without asking for user confirmation, using default answers.- Example:
zypper --non-interactive patch
- Example:
- 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
- Example:
- Quiet Output:
zypper --quiet
– Suppresses most of the output, making it useful for scripting.- Example:
zypper --quiet patch
- Example:
- XML Output:
zypper --xmlout
– Outputs the result in XML format, useful for parsing by scripts.- Example:
zypper --xmlout patch
- Example:
Zypper Shell
- Open Zypper Shell:
zypper shell
orzypper 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.
- Example:
Help and Information
- General Help:
zypper
– Lists the available global options and commands.- Example:
zypper
- Example:
- Help for Specific Command:
zypper help [command]
– Prints help for a specific command.- Example:
zypper help install
- Example:
- List Installed Packages:
zypper search -is
– Lists all installed packages.- Example:
zypper search -is
- Example:
- Show Package Information:
zypper info [package]
– Displays detailed information about a package.- Example:
zypper info git
- Example: