Do you work with Ruby gems? They are a kind of versioned library packages for the programming language Ruby. YaST has been rewritten in Ruby a few years ago.
The other day I tried a
sudo gem update --explain
… which was supposed to merely list any available new versions of installed Ruby gems. Insted of listing, the »gem« command actually updated the gems — among them a few on which YaST happens to depend: mysql3, fast_gettext etc.
After my blunder YaST kept aborting with above »Internal Error«. Later I could make YaST run again by manually removing the unvoluntary up-to-date rubygems and installing the original gems that came with YaST:
gem uninstall fast_gettext --version 2.0.1
gem uninstall sqlite3 --version 1.4.1
zypper in -force ruby2.5-rubygem-fast_gettext-1.6.0-lp150.1.4.x86_64
zypper in -force ruby2.5-rubygem-sqlite3-1.3.13-lp150.1.7.x86_64
I’m of the opinion that any gems YaST depends on ought to be handled specially, maybe incorporated into the YaST2 source base. That way, Ruby devs like myself could install/update/hack/remove our Ruby gems to our hearts’ content without interfering with the integrity of system tools like YaST, »zypper lifecycle« and so on.
At the least YaST should have better version checking of its gems and/or improve its error reporting in this case. I tried to point out this problem on Bugzilla but was rebuked.
I went looking at the YaST Ruby code that error’d and saw that it was checking for the file /var/lib/YaST2/system_packages_repos.yaml . On my system the file existed but it was empty. I deleted the file and now Software Management starts properly.
My system files may have been in an improper state because during the update from 15.0 to 15.1 the update process hung when installing the boot loader - this is on a newer HP Z2 system which “features” the HP Secure Boot. I was able make the system operational by booting with the help of installation media and having YaST re-install the boot loader. I also found later that the usual repositories were not added - I added them later using YaST.
Thanks a lot. This problem is bugging me for months now and your solution solved it for me as well. I expected it to be related to mixed versions of Ruby and tried many things. Deleting the file was enough