Yast2/Ruby Problem After Update

After a recent Tumbleweed update (which included a Ruby update) I’ve lost Yast2:

eric@linux-epth:~$ su -c '/sbin/yast2 sw_single'
Password: 
/usr/lib64/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- yast (LoadError)
from /usr/lib64/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /usr/lib/YaST2/bin/y2start:9:in `<main>'

At first I thought this may be an RVM problem but they (Yast2/RVM) have cooexisted happily up to now.

Any idea what the issue may be or how to repair Yast2?

Thank you for your help.

Ruby 2.2 has been dropped from Tumbleweed, the default (and only) one is 2.4 now.

I would suggest to run “zypper dup” to make sure your system is fully up-to-date.
If you should get a conflict please post it for further help.

Thank you, but this error is after a few days of "zypper dup"s. The OS is fully up-to-date — with BOTH 2.2.0 and 2.4.0 in /usr/lib64/ruby/!

And what repos are you using then?

zypper lr -d

What ruby packages are installed?

zypper se -si ruby

There should be no 2.2.0 at all in /usr/lib64/ruby/ I suppose.

Yes, I understand about no 2.2.0, but here is the output you requested:

eric@linux-epth:~$ zypper lr -d
Repository priorities are without effect. All enabled repositories share the same priority.


# | Alias                            | Name                       | Enabled | GPG Check | Refresh | Priority | Type   | URI                                                                                  | Service
--+----------------------------------+----------------------------+---------+-----------+---------+----------+--------+--------------------------------------------------------------------------------------+--------
1 | download.opensuse.org-non-oss    | Main Repository (NON-OSS)  | Yes     | (r ) Yes  | Yes     |   99     | yast2  | http://download.opensuse.org/tumbleweed/repo/non-oss/                                |        
2 | download.opensuse.org-oss        | Main Repository (OSS)      | Yes     | (r ) Yes  | Yes     |   99     | yast2  | http://download.opensuse.org/tumbleweed/repo/oss/                                    |        
3 | download.opensuse.org-tumbleweed | Main Update Repository     | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/update/tumbleweed/                                      |        
4 | erlang                           | erlang                     | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/repositories/devel:/languages:/erlang/openSUSE_Factory/ |        
5 | google                           | google                     | Yes     | (r ) Yes  | No      |   99     | rpm-md | http://dl.google.com/linux/chrome/rpm/stable/x86_64                                  |        
6 | google-chrome                    | google-chrome              | Yes     | ( p) Yes  | Yes     |   99     | rpm-md | http://dl.google.com/linux/chrome/rpm/stable/x86_64                                  |        
7 | openSUSE-20160407-0              | openSUSE-20160407-0        | Yes     | (r ) Yes  | No      |   99     | yast2  | iso:///?iso=/home/eric/bin/openSUSE-20160407-0.iso                                   |        
8 | repo-debug                       | openSUSE-Tumbleweed-Debug  | No      | ----      | ----    |   99     | NONE   | http://download.opensuse.org/debug/tumbleweed/repo/oss/                              |        
9 | repo-source                      | openSUSE-Tumbleweed-Source | No      | ----      | ----    |   99     | NONE   | http://download.opensuse.org/source/tumbleweed/repo/oss/ 

eric@linux-epth:~$ zypper se -si ruby
Loading repository data...
Reading installed packages...


S  | Name                            | Type    | Version     | Arch   | Repository           
---+---------------------------------+---------+-------------+--------+----------------------
i+ | libruby2_2-2_2                  | package | 2.2.4-2.1   | x86_64 | openSUSE-20160407-0  
i  | libruby2_4-2_4                  | package | 2.4.1-2.2   | x86_64 | Main Repository (OSS)
i+ | libstorage-ruby                 | package | 2.26.12-1.4 | x86_64 | Main Repository (OSS)
i+ | ruby                            | package | 2.4-1.1     | x86_64 | Main Repository (OSS)
i+ | ruby-common                     | package | 2.1-10.1    | noarch | Main Repository (OSS)
i+ | ruby2.2                         | package | 2.2.4-2.1   | x86_64 | openSUSE-20160407-0  
i+ | ruby2.2-rubygem-abstract_method | package | 1.2.1-2.1   | x86_64 | openSUSE-20160407-0  
i+ | ruby2.2-rubygem-cfa             | package | 0.3.0-1.1   | x86_64 | openSUSE-20160407-0  
i+ | ruby2.2-rubygem-cheetah         | package | 0.5.0-1.1   | x86_64 | openSUSE-20160407-0  
i+ | ruby2.2-rubygem-fast_gettext    | package | 1.0.0-1.2   | x86_64 | openSUSE-20160407-0  
i+ | ruby2.2-rubygem-gem2rpm         | package | 0.10.1-8.2  | x86_64 | openSUSE-20160407-0  
i+ | ruby2.2-rubygem-ruby-augeas     | package | 0.5.0-1.7   | x86_64 | openSUSE-20160407-0  
i+ | ruby2.2-rubygem-ruby-dbus       | package | 0.11.0-4.4  | x86_64 | openSUSE-20160407-0  
i+ | ruby2.2-stdlib                  | package | 2.2.4-2.1   | x86_64 | openSUSE-20160407-0  
i  | ruby2.4                         | package | 2.4.1-2.2   | x86_64 | Main Repository (OSS)
i  | ruby2.4-rubygem-abstract_method | package | 1.2.1-2.5   | x86_64 | Main Repository (OSS)
i  | ruby2.4-rubygem-cfa             | package | 0.6.2-1.1   | x86_64 | Main Repository (OSS)
i  | ruby2.4-rubygem-cfa_grub2       | package | 0.6.2-1.3   | x86_64 | Main Repository (OSS)
i  | ruby2.4-rubygem-cheetah         | package | 0.5.0-1.5   | x86_64 | Main Repository (OSS)
i  | ruby2.4-rubygem-fast_gettext    | package | 1.4.0-1.3   | x86_64 | Main Repository (OSS)
i  | ruby2.4-rubygem-ruby-augeas     | package | 0.5.0-3.3   | x86_64 | Main Repository (OSS)
i  | ruby2.4-rubygem-ruby-dbus       | package | 0.12.0-1.4  | x86_64 | Main Repository (OSS)
i  | ruby2.4-stdlib                  | package | 2.4.1-2.2   | x86_64 | Main Repository (OSS)
i+ | yast2-ruby-bindings             | package | 3.3.1-1.1   | x86_64 | Main Repository (OSS)

As you can see, they are both there after “sudo zypper dup”.

Thank you for your help.

What is the difference between

“The following 2 packages are going to be REMOVED:”

and

“The following 16 packages are going to be downgraded:”

in


The following 20 NEW packages are going to be installed:
  kernel-default-4.11.8-2.2 kernel-default-devel-4.11.8-2.2 kernel-devel-4.11.8-2.2 kernel-source-4.11.8-2.2 kernel-syms-4.11.8-2.2 libexiv2-26 liblz4-1 liblz4-1-32bit libruby2_4-2_4 libxmlsec1-1 libxmlsec1-nss1 ruby2.4
  ruby2.4-rubygem-abstract_method ruby2.4-rubygem-cfa ruby2.4-rubygem-cfa_grub2 ruby2.4-rubygem-cheetah ruby2.4-rubygem-fast_gettext ruby2.4-rubygem-ruby-augeas ruby2.4-rubygem-ruby-dbus ruby2.4-stdlib


The following application is going to be REMOVED:
  "GStreamer Multimedia Codecs"


The following 2 packages are going to be REMOVED:
  liblz4-1_7-32bit ruby2.2-rubygem-cfa_grub2


The following 1058 packages are going to be upgraded:
  acl acpica acpid AdobeICCProfiles alsa alsa-oss alsa-utils apparmor-abstractions apparmor-docs apparmor-parser apparmor-profiles apparmor-utils at attr audit augeas augeas-lenses autoconf automake autoyast2-installation bash bash-doc bc
  bin86 binutils binutils-devel bison bison-lang blog boost-license1_64_0 btrfsprogs btrfsprogs-udev-rules bundle-lang-common-en bundle-lang-gnome-en bzip2 cabextract cdda2wav cdrecord coreutils cpio cpio-mt cpp cpp6 cpp7 cpupower

(...)

  typelib-1_0-Pango-1_0 ucode-intel udev unixODBC unrar update-alternatives usb_modeswitch usb_modeswitch-data usbutils util-linux util-linux-systemd vaapi-dummy-driver valgrind vim vim-data w3m which wicked wicked-service wireless-tools
  xauth xdm xdm-xsession xfsprogs xinetd xinit xkbcomp xli xmodmap xorg-x11-server xorriso xprop xrandr xrdb xset xtables-plugins xterm xterm-bin xz xz-devel yast2 yast2-add-on yast2-bootloader yast2-core yast2-fonts yast2-network
  yast2-ntp-client yast2-packager yast2-ruby-bindings yast2-services-manager yast2-sound yast2-storage yast2-trans-stats yast2-vm yast2-xml yast2-ycp-ui-bindings zip zlib-devel zypper zypper-aptitude zypper-log zypper-migration-plugin


The following product is going to be upgraded:
  "openSUSE Tumbleweed"


The following 16 packages are going to be downgraded:
  gdk-pixbuf-query-loaders gdk-pixbuf-thumbnailer libexiv2-14 libgdk_pixbuf-2_0-0 liblz4-1_7 libruby2_2-2_2 ruby2.2 ruby2.2-rubygem-abstract_method ruby2.2-rubygem-cfa ruby2.2-rubygem-cheetah ruby2.2-rubygem-fast_gettext
  ruby2.2-rubygem-gem2rpm ruby2.2-rubygem-ruby-augeas ruby2.2-rubygem-ruby-dbus ruby2.2-stdlib typelib-1_0-GdkPixbuf-2_0


The following product is going to be reinstalled:
  "openSUSE NonOSS Addon"


1058 packages to upgrade, 16 to downgrade, 20 new, 2 to remove.
Overall download size: 933.7 MiB. Already cached: 0 B. After the operation, additional 875.3 MiB will be used.
Continue? [y/n/...? shows all options] (y): n

So, your output shows that the ruby2.2 packages come from this “repo”:

7 | openSUSE-20160407-0              | openSUSE-20160407-0        | Yes     | (r ) Yes  | No      |   99     | yast2  | iso:///?iso=/home/eric/bin/openSUSE-20160407-0.iso                                   |        

That’s an old installation DVD (from April 2016!).

Remove that and run zypper dup again, that should hopefully fix your problem:

sudo zypper rr 7
sudo zypper dup

What’s the difference?

The 2 packages will be uninstalled, the 16 packages will be replaced by older versions.

My guess is that the latter (the ruby 2.2 packages) have been updated since you installed the system, but as they are not in the repos any more they will be downgraded now to the version on your old installation DVD/ISO.

Thank you very much for this. Interesting! It raises 2 questions for me though:

  • I added the ISO as a repo because I disliked having to find my DVD whenever a zypper dup required it - and that is still helpful. Could I just remove the outdated Ruby 2.2.0 packages via zypper and keep the ISO repo? Do the packages have to be removed through zypper dup?
  • If the ISO repo had not been there would the dup have REMOVED the Ruby packages instead of downgrading them?

Appreciated…

There’s no need to find a DVD either.
“zypper dup” doesn’t require any DVD at all (unless you do add a DVD as repo and activate it), it just uses the online repos.
And a DVD would have the same problem anyway.

Having a fixed DVD as repo doesn’t make sense with Tumbleweed. Tumbleweed is constantly changing, all packages are being updated/upgraded over time.
You’d have to update the DVD/ISO basically everytime a new snapshot is published.

If you do like to use a DVD/ISO as repo, you should better switch to a fixed release like Leap 42.3.

Removing the packages manually should also fix your problem though.

If the ISO repo had not been there would the dup have REMOVED the Ruby packages instead of downgrading them?

Yes.

Thank you for your answer and I followed your directions. However, after deleting the ISO and doing a dup I have a new error when trying to start Yast2:

eric@linux-epth:~$ sudo zypper dup
[sudo] password for root: 
Warning: You are about to do a distribution upgrade with all enabled repositories. Make sure these repositories are compatible before you continue. See 'man zypper' for more information about this command.
Loading repository data...
Reading installed packages...
Computing distribution upgrade...


Nothing to do.
eric@linux-epth:~$ su -c '/sbin/yast2 sw_single'
Password: 
/sbin/yast2: /usr/lib/YaST2/bin/y2start: /usr/bin/ruby: bad interpreter: No such file or directory
eric@linux-epth:~$

Missing ruby exe in /usr/bin/?? :

eric@linux-epth:~$ ls /usr/bin/ruby*
/usr/bin/ruby-find-versioned  /usr/bin/ruby.ruby2.4
eric@linux-epth:~$

Right.
ruby2.2 contains /usr/bin/ruby as well, and apparently overwrote the file from ruby2.4.
And when you uninstalled ruby2.2, the file obviously got removed as well (because it was installed by ruby2.2).

That’s the problem with file conflicts… (actually you should have gotten a warning by zypper about that in the first place when ruby2.4 was installed)

Reinstall the ruby2.4 package and it should work:

sudo zypper in -f ruby2.4

(the rest of the packages shouldn’t have file overlaps between 2.2 and 2.4 I think…)

Thank you very much. I am back in business with a functioning Yast2. I appreciate it!