YAST2 broken after zypper dup

Hi,

After what I thought would be a routine zypper dup last night Yast no longer works. I can open yast after entering the root password, but none of yast’s modules open when I click on them. For example, here’s what happens when I try to open the yast software repositories module after starting yast from a terminal:

yast2
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
Run command: /sbin/yast2 repositories &
/sbin/yast2: /usr/lib/YaST2/bin/y2start: /usr/bin/ruby.ruby2.6: bad interpreter: No such file or directory

Any advice would be appreciated. I tried running zypper dup again but all the packages are up to date, supposedly.

Having had my eye on those SuSE Lizards doing YaST development sprints, I don’t think they support Ruby 2.6 for running YaST2. Try installing Ruby 2.5 and run YaST with that Ruby version.

If you really need Ruby 2.6, use a version manager like rvm or rbenv as recommended by user Tsu2 over here on another active forum thread about Ruby versions.

I find it puzzling, though, that something like »zypper dup« just clobbers a vital YaST dependency. (At the same time I hope this is the problem here, because it would be an easy fix. Fingers crossed.)

It works well for me, I have these Ruby packages

sudo zypper in libruby2_5-2 libruby2_6-2_6 _5  libstorage-ng-ruby  ruby  ruby-common  ruruby2.5  ruby2.5-stdlib ruby2.6  ruby2.6-rubygem-abstract_method  ruby2.6-rubygem-cfa  ruby2.6-rubygem-cfa_grub2  ruby2.6-rubygem-cheetah  ruby2.6-rubygem-fast_gettext  ruby2.6-rubygem-gem2rpm  ruby2.6-rubygem-ruby-augeas ruby2.6-rubygem-ruby-dbus  ruby2.6-rubygem-simpleidn  ruby2.6-rubygem-unf   ruby2.6-rubygem-unf_ext  yast2-ruby-bindings  


Be careful that you scroll the CODE because there is a part that you can not see

sudo zypper in   libstorage-ng-ruby  ruby  ruby-common  ruby2.5  ruby2.5-stdlib ruby2.6  ruby2.6-rubygem-abstract_method  ruby2.6-rubygem-cfa  ruby2.6-rubygem-cfa_grub2  ruby2.6-rubygem-cheetah  ruby2.6-rubygem-fast_gettext  ruby2.6-rubygem-gem2rpm  ruby2.6-rubygem-ruby-augeas ruby2.6-rubygem-ruby-dbus  ruby2.6-rubygem-simpleidn  ruby2.6-rubygem-unf   ruby2.6-rubygem-unf_ext  yast2-ruby-bindings

There was a mistake before

Thanks for the suggestions–I installed the suggested packages but Yast is still not working:

yast2
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
Run command: /sbin/yast2 repositories &
/sbin/yast2: /usr/lib/YaST2/bin/y2start: /usr/bin/ruby.ruby2.6: bad interpreter: No such file or directory

I’m not a developer so I don’t need Ruby apart from whatever function it serves in allowing Yast to run. Can I uninstall Ruby and then reinstall version 2.5?

So
Terminal >

su -c yast2

Thanks for your reply:

su -c yast2
Password: 
QStandardPaths: wrong ownership on runtime directory /run/user/1000, 1000 instead of 0
QStandardPaths: wrong ownership on runtime directory /run/user/1000, 1000 instead of 0
Run command: /sbin/yast2 repositories &
/sbin/yast2: /usr/lib/YaST2/bin/y2start: /usr/bin/ruby.ruby2.6: bad interpreter: No such file or directory

I get the same, but without that last line. And it works.

I notice that “/usr/bin/ruby.ruby2.6” has a recent date. It was probably installed or updated on yesterday’s update. Checking on another Tumbleweed that I have not yet updated, I see that file is not there.

Somehow you managed to update Yast but failed to install a required dependency.

How are you doing updates?

By the way, you can probably fix this with:

zypper in ruby2.6

How are you doing updates?

I always use zypper dup

zypper in ruby2.6
Loading repository data...
Reading installed packages...
'ruby2.6' is already installed.
No update candidate for 'ruby2.6-2.6.1-1.2.x86_64'. The highest available version is already installed.
Resolving package dependencies...

Nothing to do.

Puzzling. Yast is still broken.

What’s the output of

ls -l /usr/bin/ruby.ruby2.6

If that file exists, then what’s the output from

ldd /usr/bin/ruby.ruby2.6
ls -l /usr/bin/ruby.ruby2.6
ls: cannot access '/usr/bin/ruby.ruby2.6': No such file or directory

Hmm, does that mean rub2.6 was incompletely installed? I’ll try reinstalling.

Yes, a forced reinstall (“zypper in -f ruby2.6”) seems like a good idea. And then try that “ldd” command to make sure that all of the required libraries are also there.

I tried the forced reinstall:

zypper in -f ruby2.6
Retrieving repository 'Packman Repository' metadata ...............[done]
Building repository 'Packman Repository' cache ....................[done]
Loading repository data...
Reading installed packages...
Forcing installation of 'ruby2.6-2.6.1-1.2.x86_64' from repository 'openSUSE:Factory'.
Resolving package dependencies...

The following package is going to be reinstalled:
  ruby2.6

1 package to reinstall.
Overall download size: 0 B. Already cached: 3.7 MiB. No additional space
will be used or freed after the operation.
Continue? [y/n/...? shows all options] (y): y
In cache ruby2.6-2.6.1-1.2.x86_64.rpm
                                    (1/1),   3.7 MiB ( 16.4 MiB unpacked)
Checking for file conflicts: ......................................[done]
(1/1) Installing: ruby2.6-2.6.1-1.2.x86_64 ........................[done]
Additional rpm output:
update-alternatives: using /usr/bin/rake.ruby.ruby2.6 to provide /usr/bin/rake.ruby2.6 (rake.ruby2.6) in auto mode                                
update-alternatives: using /usr/bin/rdoc.ruby.ruby2.6 to provide /usr/bin/rdoc.ruby2.6 (rdoc.ruby2.6) in auto mode                                
update-alternatives: using /usr/bin/ri.ruby.ruby2.6 to provide /usr/bin/ri.ruby2.6 (ri.ruby2.6) in auto mode

Then I tried the ldd command:

ldd ruby2.6
ldd: ./ruby2.6: No such file or directory

So I"n not sure if I used the right syntax for ldd. Anyway, Yast is working again, so reinstalling ruby2.6 worked–thank you!

You need to give the full path for “ldd”. But don’t bother (except for your own interest).

Anyway, Yast is working again, so reinstalling ruby2.6 worked–thank you!

This already shows that the needed libraries are there.

I’m glad it is working again.

An update, for anyone who might be interested.

I encountered more problems with Yast yesterday–some modules wouldn’t open; others would. I also noticed that the installed kernel was 4.20.4-1, instead of the kernel that was supposed to be installed during the upgrade–4.20.6-1, so something clearly went wrong when I did a zypper dup the other day.

So, in an attempt to clean up the problems, I tried a system rollback from a snapshot, following the instructions here:https://doc.opensuse.org/documentation/leap/reference/html/book.opensuse.reference/cha.snapper.html#sec.snapper.snapshot-boot

I picked a snapshot from a week ago, booted into it, made sure everything worked, and confirmed the rollback with:

su - snapper rollback

, and rebooted. After a reboot everything was back to normal–all the yast modules that I tried worked, and the correct kernel was installed. Today I did another zypper dup, which brought in the 4.20.7-1 kernel along with kde plasma 5.15.

All in all I’m extremely impressed with opensuse. I don’t know if I could have performed such a clean and easy recovery with any other distro. So thank you, opensuse developers!

Glad everyting’s in working order again.
Just out of curiosity, though: which Ruby version(s) do you have now after the rollback? What do the following commands return on your installation now?

ruby -v
head -n 1 /usr/lib/YaST2/bin/y2start

If it’s still Ruby 2.6 with no problems, then I might be inclined to upgrade from Ruby 2.5. :wink:
Thanks!

Just out of curiosity, though: which Ruby version(s) do you have now after the rollback? What do the following commands return on your installation now?

ruby -v
ruby 2.6.1p33 (2019-01-30 revision 66950) [x86_64-linux-gnu]
head -n 1 /usr/lib/YaST2/bin/y2start
#! /usr/bin/ruby.ruby2.6 --encoding=utf-8

Hope this is helpful info!

Absolutely, thank you very much, gannicus! I will give Ruby 2.6 a try. Cheers!

Hi:
I to experience similar problems after zypper up last week. I run Leap 15.1 not Thumbelweed, nevertheless I hope to get some useful info.
So, every time I open the konsole as a user I get the error:

:~> bash
bash: mc: line 1: syntax error: unexpected end of file
bash: error importing function definition for `mc'

Running yast2 from konsole gives the following error:

# yast2
/bin/bash: mc: line 1: syntax error: unexpected end of file
/bin/bash: error importing function definition for `mc'
QStandardPaths: wrong ownership on runtime directory /run/user/1000, 1000 instead of 0
QStandardPaths: wrong ownership on runtime directory /run/user/1000, 1000 instead of 0
QStandardPaths: wrong ownership on runtime directory /run/user/1000, 1000 instead of 0

I entered commands as mentioned in previous comments:

# ls -l /run/user/
total 0
drwxr-xr-x 3 root  root   60 sep 30 15:59 0
drwx------ 9 my_user users 280 sep 30 15:49 1000

# ls -la /run/user/
total 0
drwxr-xr-x  4 root  root    80 sep 30 15:53 .
drwxr-xr-x 34 root  root  1020 sep 30 16:09 ..
drwxr-xr-x  3 root  root    60 sep 30 15:59 0
drwx------  9 my-user users  280 sep 30 15:49 1000

And the worst thing is I can not run yast by clicking on icon in Plasma. The window pops up requesting a user password. I enter the correct password but same window pops up again, and again etc.
Any help would be greatly appreciated.

Bojan