This article explains how to use Zypper for package management in SUSE Linux and openSUSE, covering installation, removal, and repository management.
Zypper is the powerful command-line package manager for SUSE Linux and openSUSE, providing functionality similar to YUM and APT. It enables you to install, update, and remove packages, automatically resolving dependencies. Because Zypper relies on up-to-date repository metadata, it’s best practice to refresh before performing searches or installations.
You need sudo privileges to run Zypper commands that modify the system.
Always refresh metadata to ensure you get the latest package versions.
Install a package from enabled repositories with the in (install) command:
Copy
Ask AI
sudo zypper in unrar
Interactive example:
Copy
Ask AI
Resolving package dependencies...The following NEW package is going to be installed: unrar1 new package to install.Overall download size: 141.2 KiB. After the operation, additional 301.6 KiB will be used.Continue? [y/n/v/...? shows all options] (y): yRetrieving package unrar-5.7.5-lp151.1.1.x86_64 ...................................[done](1/1) Installing: unrar-5.7.5-lp151.1.1.x86_64 ..........................................[done]
Use the rm (remove) command to uninstall a package and any packages that depend on it:
Copy
Ask AI
sudo zypper rm unrar
Example:
Copy
Ask AI
Resolving package dependencies...The following package is going to be REMOVED: unrar1 package to remove.After the operation, 301.6 KiB will be freed.Continue? [y/n/v/...? shows all options] (y): y(1/1) Removing unrar-5.7.5-lp151.1.1.x86_64 ..........................................[done]
Removing packages may also uninstall dependencies required by other applications. Double-check the list before confirming.