Zypper is the command-line package management tool used in openSUSE and SUSE Linux Enterprise systems. It allows users to install, remove, and manage software packages from repositories. Zypper is known for its speed, dependency resolution capabilities, and ease of use.
Update Package Repositories
sudo zypper refresh
This command refreshes the repository metadata to ensure you have the latest package information.
Search for Packages
zypper search <package_name>
Use this command to search for packages by name or description.
Install a Package
sudo zypper install <package_name>
This installs the specified package along with its dependencies.
Remove a Package
sudo zypper remove <package_name>
This command removes the specified package from your system.
Upgrade Packages
sudo zypper update
This upgrades all installed packages to their latest versions available in the repositories.
Dist Upgrade
sudo zypper dist-upgrade
This command not only upgrades installed packages but also handles changing dependencies, such as installing or removing packages as needed.
Add a Repository
sudo zypper addrepo <repo_url> <repo_name>
This adds a new repository to the system.
Remove a Repository
sudo zypper removerepo <repo_name>
This command removes the specified repository.
List Repositories
zypper repos
This displays all currently configured repositories.
Modify Repository Priority
sudo zypper modifyrepo --priority <priority_value> <repo_name>
This command changes the priority of a repository. Lower values mean higher priority.
Show Package Info
zypper info <package_name>
Displays detailed information about a package.
Clean Up Unused Packages
sudo zypper clean
This command removes cached files and data to free up space.
List Installed Packages
zypper se --installed-only
Lists all installed packages on the system.
Check for Package Updates
zypper list-updates
Lists all packages that have updates available.
Patch Management
sudo zypper patch
Applies all necessary patches to the system.
Here’s a simple workflow using Zypper:
Refresh the repositories:
sudo zypper refresh
Search for a package:
zypper search vim
Install the package:
sudo zypper install vim
Update all packages:
sudo zypper update
Remove a package:
sudo zypper remove vim
Zypper is powerful and offers a wide range of options for managing software on your system. For more detailed information, you can consult the Zypper manual by running:
man zypper
For additional resources and community support, you can visit the openSUSE Zypper documentation and the SUSE Linux Enterprise Zypper documentation.