'yast2 is broken after executing `zypper update`

I am a newer to use openSUSE. Recently I execute zypper update and found yast2 UI client cannot be launched. I can see the log in /var/log/YaST2/y2log:

2020-03-30 02:30:06 <1> linux-fjbu(26996) [Ruby] yast/wfm.rb:308 Call client /usr/share/YaST2/clients/sw_single.rb
2020-03-30 02:30:06 <1> linux-fjbu(26996) [Pkg] PkgModule.cc(instance):68 Redirecting ZYPP log to y2log
2020-03-30 02:30:07 <2> linux-fjbu(26996) [Ruby] yast/i18n.rb:61 luocanwei debug: found:true; str:"Print the help for this module"
2020-03-30 02:30:07 <3> linux-fjbu(26996) [Y2Ruby] binary/Y2RubyUtils.cc(y2_require):26 cannot require yast:undefined method `_' for FastGettext::Translation:Module at /usr/lib64/ruby/vendor_ruby/2.5.0/yast/i18n.rb:62:in `_'
2020-03-30 02:30:07 <3> linux-fjbu(26996) [Y2Ruby] binary/Y2RubyUtils.cc(y2_require):26 cannot require yast:undefined method `message' for nil:NilClass at /usr/lib64/ruby/vendor_ruby/2.5.0/yast/yast.rb:186:in `import_pure'
2020-03-30 02:30:07 <3> linux-fjbu(26996) [Y2Ruby] binary/Y2RubyComponent.cc(import):100 Reporting runtime error for import of module 'PackageCallbacks' message 'undefined method `message' for nil:NilClass'
2020-03-30 02:30:07 <3> linux-fjbu(26996) [Interpreter] yast/i18n.rb:145 Runtime error when loading module 'PackageCallbacks'
2020-03-30 02:30:07 <2> linux-fjbu(26996) [Ruby] yast/builtins.rb:586 tostring builtin called on wrong type Class
2020-03-30 02:30:07 <3> linux-fjbu(26996) [Ruby] yast/wfm.rb:253 Client /usr/share/YaST2/clients/sw_single.rb failed with 'Failed to load Module 'PackageCallbacks' due to: undefined method `message' for nil:NilClass' (RuntimeError).
Backtrace:
/usr/lib64/ruby/vendor_ruby/2.5.0/yast/yast.rb:186:in `import_pure'
/usr/lib64/ruby/vendor_ruby/2.5.0/yast/yast.rb:186:in `import'
/usr/share/YaST2/modules/PackageCallbacks.rb:61:in `main'
/usr/share/YaST2/modules/PackageCallbacks.rb:3219:in `<module:Yast>'
/usr/share/YaST2/modules/PackageCallbacks.rb:30:in `<top (required)>'
/usr/lib64/ruby/vendor_ruby/2.5.0/yast/yast.rb:186:in `import_pure'
/usr/lib64/ruby/vendor_ruby/2.5.0/yast/yast.rb:186:in `import'
/usr/share/YaST2/clients/sw_single.rb:24:in `main'
/usr/share/YaST2/clients/sw_single.rb:801:in `<top (required)>'
/usr/lib64/ruby/vendor_ruby/2.5.0/yast/wfm.rb:313:in `eval'
/usr/lib64/ruby/vendor_ruby/2.5.0/yast/wfm.rb:313:in `run_client'
/usr/lib64/ruby/vendor_ruby/2.5.0/yast/wfm.rb:206:in `call_builtin'
/usr/lib64/ruby/vendor_ruby/2.5.0/yast/wfm.rb:206:in `call_builtin_wrapper'
/usr/lib64/ruby/vendor_ruby/2.5.0/yast/wfm.rb:195:in `CallFunction'
/usr/lib/YaST2/bin/y2start:58:in `<main>'
2020-03-30 02:30:07 <3> linux-fjbu(26996) [Ruby] yast/wfm.rb:276 Internal error. Please report a bug report with logs.
Run save_y2logs to get complete logs.
Details: Failed to load Module 'PackageCallbacks' due to: undefined method `message' for nil:NilClass
Caller:  /usr/lib64/ruby/vendor_ruby/2.5.0/yast/yast.rb:186:in `import_pure'

I had report the bug https://bugzilla.suse.com/show_bug.cgi?id=1167315, but got no answer for a week.

How can I fix this problem. Thanks.



Solution 1:[1]

With the help of Stefan, my problem is fixed.

The reason is that the version of the input method software(Leap 15.1) I installed recently conflicts with the system version(Leap 15.0).

My solution is as follow:

(1) remove the M17N repo(Leap 15.1)

sudo zypper rr 1  ## 1 is the index number of M17N after `sudo zypper lr`

(2) add the M17N repo(Leap 15.0)

sudo zypper ar -f https://download.opensuse.org/repositories/home:/MargueriteSu:/branches:/M17N/openSUSE_Leap_15.0/home:MargueriteSu:branches:M17N.repo

(3) update repo

sudo zypper update

(4) uninstall sogou-pinyin/yast2(including kde_yast and yast2_basis)/fast_gettext

sudo zypper remove sogou-pinyin
sudo zypper remove yast2-ruby-bindings
sudo zypper remove ruby2.5-rubygem-fast_gettext
sudo gem uninstall fast_gettext

(5) reinstall yast2

sudo zypper install patterns-kde-kde_yast
sudo zypper install patterns-yast-yast2_basis

(6) reinstall sogou-pinyin

sudo zypper install sogou-pinyin

My yast2 rebirths.

Solution 2:[2]

I've had the same problem with openSUSE Tumblweed. The reason was that the new yast needed ruby 3.1 but 3.0 was installed. So I did the following steeps:

(1)

sudo zypper remove yast2-ruby-bindings
sudo zypper remove ruby

(2)

sudo zypper in autoyast2-installation patterns-kde-kde_yast patterns-yast-yast2_basis patterns-yast-yast2_desktop yast2 yast2-add-on yast2-apparmor yast2-bootloader yast2-control-center yast2-control-center-qt yast2-country yast2-country-data yast2-firewall yast2-hardware-detection yast2-installation yast2-journal yast2-ldap yast2-metapackage-handler yast2-network yast2-ntp-client yast2-online-update yast2-online-update-configuration yast2-online-update-frontend yast2-packager yast2-pam yast2-printer yast2-proxy yast2-ruby-bindings yast2-samba-client yast2-samba-server yast2-scanner yast2-security yast2-services-manager yast2-slp yast2-snapper yast2-sound yast2-storage-ng yast2-sudo yast2-sysconfig yast2-transfer yast2-tune yast2-update yast2-users yast2-vm

At step two I was asked the following:

Problem: das zu installierende patterns-kde-kde_yast-20220215-1.2.noarch erfordert 'yast2-control-center-qt', aber diese Anforderung kann nicht bereitgestellt werden
  Nicht installierbare Anbieter: yast2-control-center-qt-4.5.0-1.1.i586[download.opensuse.org-oss]
                   yast2-control-center-qt-4.5.0-1.1.x86_64[download.opensuse.org-oss]
 Lösung 1: Folgende Aktionen werden ausgeführt:
  Deinstallation von ruby3.0-3.0.3-1.3.x86_64
  Deinstallation von ruby3.0-rubygem-abstract_method-1.2.1-2.23.x86_64
  Deinstallation von ruby3.0-rubygem-cfa-1.0.2-1.10.x86_64
  Deinstallation von ruby3.0-rubygem-cfa_grub2-2.0.0-1.10.x86_64
  Deinstallation von ruby3.0-rubygem-cheetah-1.0.0-1.2.x86_64
  Deinstallation von ruby3.0-rubygem-fast_gettext-2.0.3-1.7.x86_64
  Deinstallation von ruby3.0-rubygem-gem2rpm-0.10.1-17.8.x86_64
  Deinstallation von ruby3.0-rubygem-nokogiri-1.12.5-1.3.x86_64
  Deinstallation von ruby3.0-rubygem-ruby-augeas-0.5.0-3.25.x86_64
  Deinstallation von ruby3.0-rubygem-ruby-dbus-0.16.0-1.4.x86_64
  Deinstallation von ruby3.0-rubygem-simpleidn-0.2.1-1.5.x86_64
  Deinstallation von ruby3.0-rubygem-unf-0.1.4-1.22.x86_64
  Deinstallation von ruby3.0-rubygem-unf_ext-0.0.8-1.2.x86_64
 Lösung 2: patterns-kde-kde_yast-20220215-1.2.noarch nicht installieren
 Lösung 3: patterns-kde-kde_yast-20220215-1.2.noarch durch Ignorieren einiger Abhängigkeiten brechen

Wählen Sie aus den obigen Lösungen mittels Nummer oder brechen Sie (a)b [1/2/3/a/d/?] (a): 1
Abhängigkeiten werden aufgelöst...
Paketabhängigkeiten werden aufgelöst...

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Nyrine