sudo zypper... commands hang


I’ve upgraded my system from Leap 15.2 -> 15.3 and after that I’ve done an extensive update with zypper up. Now whatever zypper command I execute as a regular user and prefix it with sudo hangs on the terminal and gives no output. For example sudo zypper ref.

Whatever zypper commands run fine when run as root, or when ran as a regular user and prefixed with su -c which suggests there might be some problem with sudo but other programs executed as a regular user and prefixed with sudo run fine too.

I’ve tried to force-reinstall the zypper & sudo pkgs and have replaced the */etc/sudoers *file with the default one just in case but to no avail.

Also, when running a zypper command as a regular user and with no command elevation like su or sudo, it works fine as well.

Can you help me with that?

Is that only one “regular user” you talk about, or is it the same for all "regular"users?

When it is only one, please show the line where it is defined in /etc/passwd (just a wild guess from me).

I just tried it with a new regular user and the situation is the same. zypper commands w/o elevation (no sudo nor su) work, su -c “zypper …” commands work too, but sudo zypper… commands hang.

By a regular user I mean a user with the default “users” group and maybe wheel but no other membership.

I checked /var/log/zypper.log but nothing is added to it when running *sudo zypper… *cmds no even with sudo zypper -vv…

What output do you get from:

sudo id

Adding (with edit):

Here, the output is:

% sudo id
[sudo] password for root: 
uid=0(root) gid=0(root) groups=0(root)

My output is the same.

We believe you (in this case), but please do not tell stories like this, but show what you have on the terminal. Same as @nrickert showed: prompt/command line, all output and best even the next prompt (to show it is complete), all copied/pasted between CODE tags (the # button in the tool bar of the post editor).

Sometimes people see details you are not aware of. In any case, what the computer tells is true, the stories you tell are nice or interesting at the most. :wink:

Very well:

david@atronach-opensuse:~> LANG=en_US sudo id
uid=0(root) gid=0(root) groups=0(root)

Thanks, but it was for the future (I said " we believe you ;)).

BTW, LANG=C is shorter (and maybe better, I am not sure).

I hope you do not think I am only thinking about how you post, for you to find a solution is of course more important. But until now I am out of ideas :(.

Something with PAM maybe? Did you ever configure or added plug-ins into PAM?

And maybe to compare, as your normal user:


You were right, it was caused by a bad config in PAM I made there!

For some time I had had the line:

auth      sufficient trust use_uid

…in /etc/pam.d/su & su-l config files to suppress password requirement when running su & kdesu commands

Since there already was a similar line:

auth      sufficient

…in those files, I decided to merge those 2 lines into:

auth      sufficient trust use_uid

It seemed to be working for a while until I ran some sudo zypper command which was a bit later so I didn’t realize the correlation there.
If I move the PAM module back on its own line in the su-l config file, sudo zypper commands start to work.
It’s strange though that the su-l config can break the sudo behavior while it should only affect the su behaviour. There’s a specific sudo config in /etc/pam.d which I would guess should be intended for the sudo behaviour.

Thanks a lot for help.

I never took the trouble to meddle with PAM, so most of what you did there and why is a bit beyond my understanding (and avoiding root password security is also beyond my understanding).

In any case, su and sudo are not related at all. They are different programs. Both can switch to another user, but that is the only thing they have in common.

I never use sudo. I have no use for it. Using su -l (or short su -) works for me and avoids trouble with sudo (I even saw security updates for sudo once, which means that it is complicated enough to let it’s programmers make errors).

And starting from the KDE main menu: Terminal in Superuser mode does use su -. Thus I mostly use that in the few cases that I need to manage my system (or when I need root to re-create problems posted in the forums ;)).