25 Zypper Commands to Manage ‘Suse’ Linux Package Management


Introduction

SUSE Linux is a popular operating system in Linux community, and its package management system plays a vital role in overall performance of OS. Zypper is command-line package manager for SUSE Linux and is used to install, update, and remove packages on system. In this article, we will discuss 25 Zypper commands that will help you manage your SUSE Linux package management system efficiently.

Installing Packages with Zypper

To install packages using Zypper, use following command −

sudo zypper install <package-name>

For example, to install Firefox browser, use following command −

sudo zypper install firefox

Removing Packages with Zypper

To remove a package using Zypper, use following command −

sudo zypper remove <package-name>

For example, to remove Firefox browser, use following command −

sudo zypper remove firefox

Updating Packages with Zypper

To update all packages on your system, use following command −

sudo zypper update

Updating Specific Packages with Zypper

To update specific packages, use following command −

sudo zypper update <package-name>

For example, to update Firefox browser, use following command −

sudo zypper update firefox

Listing All Installed Packages

To list all packages installed on your system, use following command −

sudo zypper pa

Listing Available Packages

To list all packages available in repositories, use following command −

sudo zypper se <package-name>

For example, to list all available packages related to Firefox browser, use following command −

sudo zypper se firefox

Refreshing Repositories

To refresh repositories on your system, use following command −

sudo zypper ref

Adding Repositories

To add a new repository to your system, use following command −

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

For example, to add Google Chrome repository to your system, use following command −

sudo zypper addrepo https://dl.google.com/linux/chrome/rpm/stable/x86_64/ google-chrome

Listing Repositories

To list all repositories on your system, use following command −

sudo zypper lr

Removing Repositories

To remove a repository from your system, use following command −

sudo zypper removerepo <repository-name>

For example, to remove Google Chrome repository from your system, use following command −

sudo zypper removerepo google-chrome

Upgrading System

To upgrade your system to latest version, use following command −

sudo zypper dup

Cleaning System

To clean your system of any unnecessary packages and files, use following command −

sudo zypper clean

Resolving Dependency Issues

To resolve any dependency issues, use following command −

sudo zypper verify

Checking for Updates

To check for any available updates, use following command −

sudo zypper list-updates

Locking Packages

To lock a package and prevent it from being updated, use following command −

sudo zypper addlock <package-name>

For example, to lock Firefox browser package, use following command −

sudo zypper addlock firefox

Unlocking Packages

To unlock a package and allow it to be updated, use the previous article −

sudo zypper removelock <package-name>

For example, to unlock Firefox browser package, use following command −

sudo zypper removelock firefox

Ignoring Package Updates

To ignore a package update, use following command −

sudo zypper addtaboo <package-name>

For example, to ignore update for Firefox browser package, use following command −

sudo zypper addtaboo firefox

Removing Ignored Package Updates

To remove a package from ignored list, use following command −

sudo zypper removetaboo <package-name>

For example, to remove Firefox browser package from ignored list, use following command −

sudo zypper removetaboo firefox

Installing Packages from a Specific Repository

To install a package from a specific repository, use following command −

sudo zypper in <package-name> --from <repository-name>

For example, to install latest version of Firefox browser from Mozilla repository, use following command −

sudo zypper in firefox --from mozilla

Removing Packages with Dependencies

To remove a package along with its dependencies, use following command −

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

For example, to remove Firefox browser along with its dependencies, use following command −

sudo zypper remove --clean-deps firefox

Displaying Package Information

To display information about a package, use following command −

sudo zypper info <package-name>

For example, to display information about Firefox browser package, use following command −

sudo zypper info firefox

Displaying Package Change Log

To display change log of a package, use following command −

sudo zypper changelog <package-name>

For example, to display change log of Firefox browser package, use following command −

sudo zypper changelog firefox

Displaying Package Dependencies

To display dependencies of a package, use following command −

sudo zypper dependencies <package-name>

For example, to display dependencies of Firefox browser package, use following command −

sudo zypper dependencies firefox

Displaying Repository Information

To display information about a repository, use following command −

sudo zypper repo-info <repository-name>

For example, to display information about Mozilla repository, use following command −

sudo zypper repo-info mozilla

Displaying Repository URLs

To display URLs of all repositories on your system, use following command −

sudo zypper repos --uri

Cleaning Package Cache

To clean package cache and remove all downloaded packages, use following command −

sudo zypper clean

Displaying Package Dependencies Tree

To display a tree of package dependencies, use following command −

sudo zypper deptree <package-name>

For example, to display a tree of dependencies for Firefox browser package, use following command −

sudo zypper deptree firefox

Updating Package Lists

To update package lists on your system, use following command −

sudo zypper refresh

Displaying Package Patches

To display available patches for installed packages, use following command −

sudo zypper list-patches

Updating Package Patches

To update installed packages with available patches, use following command −

sudo zypper patch

Displaying Available Repositories

To display all available repositories on your system, use following command −

sudo zypper lr -u

Disabling a Repository

To disable a repository, use following command −

sudo zypper mr -d <repository-name>

For example, to disable Mozilla repository, use following command −

sudo zypper mr -d mozilla

Enabling a Disabled Repository

To enable a disabled repository, use following command −

sudo zypper mr -e <repository-name>

For example, to enable Mozilla repository, use following command −

sudo zypper mr -e mozilla

Displaying Package Licenses

To display licenses of installed packages, use following command −

sudo zypper licenses

Displaying Recommended Packages

To display recommended packages for a specific package, use following command −

sudo zypper recommends <package-name>

For example, to display recommended packages for Firefox browser package, use following command −

sudo zypper recommends firefox

Conclusion

Zypper is a powerful command-line package manager for SUSE Linux, and it offers a wide range of commands that help manage package management system on system. In this article, we have discussed 25 Zypper commands that will help you manage your SUSE Linux package management system efficiently. We hope this article has been helpful in increasing your understanding of Zypper and its commands.

Updated on: 28-Mar-2023

966 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements