Zypper is a very easy to use and powerful package manager that is very underrated. With the latest rewrites in openSUSE 11.0 of libzypp it is blazingly fast and has a few new features that many people are not aware of.
Here is a quick overview of a few of the features zypper supports
Install and remove packages by name, version, or capability.
Installing and removing packages with wildcards
# zypper rm gtk*devel*
# zypper in gtk-sharp?
Handling multiple versions of a package
# zypper in package-1.2.3
# zypper rm package>1.2.3
Install and Remove at the same time, - means remove, + means install.
# zypper in <package to install> -<package to remove> +<another package to install>
Force a re-install
# zypper in --force <package>
Install plain RPM files and satisfy dependencies from repositories from a local disk or the web.
# zypper in ./file.rpm
# zypper in http://<url>/file.rpm
Update all installed packages with newer available version where possible
To get all updates that only include patches/bug fixes you can run this command:
# zypper up
To update all packages even if they are new versions, or to upgrade from one version of openSUSE to another:
# zypper dup
Manage Source / Development Packages
Install build dependencies for a package
# zypper si -d <package>
Pattens / Metapackages
You can list all available patterns by doing:
# zypper pt
Install the pattern xfce
# zypper in -t pattern xfce
Easily manage repositories
List repositories
# zypper lr
Add a repository
# zypper ar <url> <name>
Disable the first repository
# zypper mr -d 1
Disable a repository by name
# zypper mr -d repo-oss
Remove the first repository
# zypper rr 1
Getting info on packages
Searching for a package
# zypper se banshee-1
# zypper se bans*
Searching for a pattern/metapackage
# zypper se -t pattern media
By default, searching only gives you the name, summary, and type of a package, to get more detailed information like what repository its coming from and what version it is, you can do the following.
# zypper se -s package
View a short description of a package
# zypper if package
Other Cool Tricks
You can simulate any zypper command by putting --dry-run after them
# zypper in --dry-run <package>
You can lock a package in its current state (installed/not installed)
# zypper addlock <package>
# zypper removelock <package>
To get more information on the new features of zypper and how to effectively use it, you may check out these additional resources:
http://en.opensuse.org/Zypper/Features
http://en.opensuse.org/Zypper/Usage