Learn how to use your zypper

First off, zypper has more fun.

Add a group so your favorite user can use zypper through sudo.

Use YaST to add a group “zypper” with GID 32000
Modify your favorite user to belong to the group zypper. This is used for password-less zypper usage. Then add the rule to sudo.

Add a new group zypper.

Add your favorite user to the zypper group.

User,group, or user alias %zypper
Host or Host Alias ALL
No Password check
Add command /usr/bin/zypper

Now your user is ready to rock out with zypper.

Add a repository
zypper addrepo (ar) [options] <URI> <alias>

sudo zypper ar

Index of /distribution/11.0/repo/oss “openSUSE 11.0 OSS”

List all repositories with URI
zypper repos (lr) [options]

zypper lr -u

Refresh all repositories
zypper refresh (ref) [alias|#|URI]

sudo zypper ref

List all uninstalled patterns
zypper patterns (pt) [options] [repository]

zypper pt -u

Install a pattern
zypper install (in) [options] <capability|rpm_file_uri>

sudo zypper in -t pattern kde4_xgl

Perform a distribution upgrade
zypper dist-upgrade (dup) [options]

sudo zypper dup

See the zypper wiki
man zypper
#zypper in konqueror

MANY THANKS for this!

One comment … Reference:

I think you mean
zypper -v lr

if you put [noparse][noparse][/noparse][/noparse] tags around the URL, it won’t be parsed by vB. so it will look like this

Add a repository
zypper addrepo (ar) [options] <URI> <alias>

sudo zypper ar [noparse]http://download.opensuse.org/distribution/11.0/repo/oss/[/noparse] “openSUSE 11.0 OSS”

Nice tip. :cool:

zypper lr -u means list all repositories with URI.

Ok, this is more clear now. Your post is for openSUSE-11.0 zypper and NOT for openSUSE-10.3 zypper. I missed the point where the distinction was made.

In openSuSE-10.3, if one types “zypper lr -u” one gets “Unknown option -u”
In openSUSE-11.0, if one types “zypper lr -u” one gets what you noted.

In openSuSE-10.3, if one types “zypper -v lr” one gets the same as if one typed “zypper lr -u” in openSUSE-11.0

In openSUSE-11.0, if one types “zypper -v lr” one gets the same as typing “zypper lr” in openSUSE-10.3/11.0 (ie the “-v” option is ignored in this case in 11.0).

You’re absolutely correct. I should have clearly stated that this was regarding zypper in openSUSE 11.0. :o

Very nice post benstein! Zypper has a lot of power, and this does make it more fun to use.

The only word of caution that comes to mind is that anything could be installed by this user without any restrictions… Which is what you want, but just good to keep in mind :wink:

Thanks for the info!

Zypper is great.

I still love Yast especially now with how fast it is, but Zypper is still a handy way to add stuff.

Yast to install KDE4-Kshisen the game kept trying to do impossible updates to konqueror plugins it couldn’t find and needed a higher kde4 base along other things that weren’t in the normal repos. so I couldn’t get that game on.

I could just go onto zypper and put in the name and get did get that other issue occuring at all

Read this part of my post ignore the rest. I meant to edit something by mistake and messed up, now the edit option is gone after hitting submit early. so if my first post makes no sense ignore it

Q: I can’t find any build-dep option? Where is iiiiiit?!?
A: No shouting please ;). The zypper equivalent is ‘zypper si -d package


Thanks for the good introduction!
And in contrast to many other tools, zypper’s man page is excellent.

However, I’m desperately looking for the old YaST2 feature of “install all matching -devel packages”. With just one click, you got all header and include files you might ever need…
Formerly under “Extras” in YaST2, this appears to be gone in favor of -debuginfo and -debugsource…
Does anyone know how to do that with zypper? I cannot do

zypper in -t pattern \*-devel

Reading installed packages…
‘*-devel’ not found.
Resolving package dependencies…
Nothing to do.

Is there any other way I can do this?


I’ve tried this in Yast except in the last step there is now another option “Run as or run as alias”. I tried “as root” or “as (my user name)”. Neither works. What do I miss here plz?

I simplify it.
I just do

#zypper <and whatever command and software I want>

Now $ represents someone running on a user account with out root/admin priveledges. Where as # represents someone running with root priveledges. Don’t forget to use

zypper --help