You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

CentOS 7 x64环境下Electron运行缺失libgtk-x11-2.0.so.0库求助

Fix for Electron "libgtk-x11-2.0.so.0: cannot open shared object file" on CentOS 7 x64

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:

  1. Install the missing system dependencies
    Run this yum command to install all the required libraries, including the libgtk-x11-2.0.so.0 you’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-devel
    

    This command covers all the common graphical dependencies Electron needs to run on CentOS 7. The gtk2-devel package specifically includes the libgtk-x11-2.0.so.0 library that’s throwing your error.

  2. Verify the fix
    Once the installation finishes, try running the electron command again:

    electron
    

    It 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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.20 11:14:09