25 Zypper Commands to Manage 'Suse' Linux Package Management

Zypper is the command-line package manager for SUSE Linux and openSUSE distributions. It provides a comprehensive set of tools to install, update, remove, and manage software packages on your system. This article covers 25 essential Zypper commands that will help you efficiently manage your SUSE Linux package management system.

Basic Package Operations

1. Installing Packages

To install packages using Zypper

sudo zypper install <package-name>

For example, to install Firefox browser

sudo zypper install firefox

2. Removing Packages

To remove a package using Zypper

sudo zypper remove <package-name>

For example, to remove Firefox browser

sudo zypper remove firefox

3. Removing Packages with Dependencies

To remove a package along with its unused dependencies

sudo zypper remove --clean-deps <package-name>

For example, to remove Firefox browser along with its dependencies

sudo zypper remove --clean-deps firefox

System Updates

4. Updating All Packages

To update all packages on your system

sudo zypper update

5. Updating Specific Packages

To update specific packages

sudo zypper update <package-name>

For example, to update Firefox browser

sudo zypper update firefox

6. System Distribution Upgrade

To upgrade your system to the latest distribution version

sudo zypper dup

7. Checking for Updates

To check for available updates without installing them

sudo zypper list-updates

Package Information and Search

8. Listing Installed Packages

To list all packages installed on your system

sudo zypper pa --installed-only

9. Searching for Packages

To search for available packages in repositories

sudo zypper se <package-name>

For example, to search for Firefox-related packages

sudo zypper se firefox

10. Displaying Package Information

To display detailed information about a package

sudo zypper info <package-name>

11. Displaying Package Dependencies

To display dependencies of a package

sudo zypper what-requires <package-name>

12. Displaying Package Dependencies Tree

To display a tree view of package dependencies

sudo zypper se --requires <package-name>

Repository Management

13. Refreshing Repositories

To refresh repository metadata

sudo zypper refresh

14. Adding Repositories

To add a new repository to your system

sudo zypper addrepo <repository-url> <repository-name>

For example, to add the Packman repository

sudo zypper addrepo https://ftp.gwdg.de/pub/linux/misc/packman/suse/openSUSE_Tumbleweed/ packman

15. Listing Repositories

To list all repositories on your system

sudo zypper lr

16. Displaying Repository URLs

To display URLs of all repositories

sudo zypper repos --uri

17. Removing Repositories

To remove a repository from your system

sudo zypper removerepo <repository-name>

18. Disabling a Repository

To disable a repository temporarily

sudo zypper mr -d <repository-name>

19. Enabling a Repository

To enable a previously disabled repository

sudo zypper mr -e <repository-name>

Package Locks and Patches

20. Locking Packages

To lock a package and prevent it from being updated

sudo zypper addlock <package-name>

21. Unlocking Packages

To unlock a package and allow it to be updated

sudo zypper removelock <package-name>

22. Displaying Available Patches

To display available security and bug fix patches

sudo zypper list-patches

23. Installing Patches

To install available patches

sudo zypper patch

System Maintenance

24. Cleaning Package Cache

To clean package cache and remove downloaded package files

sudo zypper clean

25. Verifying System Integrity

To verify the integrity of installed packages and resolve dependency issues

sudo zypper verify

Advanced Options

Many Zypper commands support additional options for more precise control. You can use --dry-run to preview changes, --no-confirm to skip confirmation prompts, and --from <repo> to install from a specific repository.

Conclusion

Zypper is a powerful and versatile package manager that provides comprehensive control over SUSE Linux package management. These 25 commands cover the essential operations from basic package installation to advanced system maintenance, enabling efficient management of your SUSE Linux system.

Updated on: 2026-03-17T09:01:38+05:30

3K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements