CentOS 7 x64环境下Electron运行缺失libgtk-x11-2.0.so.0库求助
Hey there, I’ve dealt with this exact error on CentOS 7 before—let’s get you sorted out. The problem here is that Electron relies on several GTK and X11 system libraries that aren’t installed by default (especially if you’re using a minimal CentOS 7 setup).
Here’s the step-by-step fix:
Install the missing system dependencies
Run this yum command to install all the required libraries, including thelibgtk-x11-2.0.so.0you’re missing:sudo yum install -y gtk2-devel libX11-devel libXScrnSaver-devel GConf2 nss libXtst alsa-lib-devel atk-devel cups-devel libXcomposite-devel libXcursor-devel libXdamage-devel libXext-devel libXfixes-devel libXi-devel libXrandr-devel libXrender-devel pango-develThis command covers all the common graphical dependencies Electron needs to run on CentOS 7. The
gtk2-develpackage specifically includes thelibgtk-x11-2.0.so.0library that’s throwing your error.Verify the fix
Once the installation finishes, try running theelectroncommand again:electronIt should launch without the shared library error now.
If you still run into issues, double-check that you didn’t miss any output during the yum installation (sometimes dependencies fail to resolve if your repo config is off). But in most cases, this full set of dependencies will cover the problem.
内容的提问来源于stack exchange,提问作者newbie

