Friday 19 September 2008

OpenSUSE: Install RPM packages with zypper CLI tool

Open Suse Linux uses RPM packages for software installation. Those files end in .rpm extension.
Most Suse users are familiar with the YaST graphic interface, but sometimes the quicker way to install a RPM package is from command line with the tool named zypper. This tool is similar to apt-get tool that Debian users use to install .deb packages and it uses already configured repositories to fetch packages. I'll explain its basic usage here.
All zypper commands have its longer and readable variant, and its shorter and less readable one. Commands for installing, removing and updating software needs root privileges.

Commands for software management:

Installing software

$ zypper install [package name]
$ zypper in [package name]


Removing software

$ zypper remove [package name]
$ zypper rm [package name]


Updating all installed software

$ zypper update
$ zypper up


Distribution upgrade

$ zypper dist-upgrade
$ zypper dup


Note: All of the above commands require root priviledeges.

Commands for software querying:

Search for packages matching a pattern

$ zypper search [pattern]
$ zypper se [pattern]


Show package information

$ zypper info [package]
$ zypper se [package]


Commands for repository management:

List all repositories

$ zypper repos
$ zypper lr


For all other commands and help type:

$ zypper --help

No comments: