V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
s609926202
V2EX  ›  问与答

Centos7 如何正确的安装依赖包?

  •  
  •   s609926202 · 2018-08-28 10:41:09 +08:00 · 3715 次点击
    这是一个创建于 2040 天前的主题,其中的信息可能已经有所发展或是发生改变。

    比如我运行程序时发生了这么一段错误:

    ┏ Electron -------------------
    
      /home/wwwroot/topsi-project-manager/node_modules/electron/dist/electron: error while loading shared libraries: libXtst.so.6: cannot open shared object file: No such file or directory
      
    ┗ ----------------------------
    

    显然是缺少这个 libXtst.so.6 依赖库的,那么我的安装方法如下:

    # yum whatprovides libXtst.so.6
    

    找到提供这个依赖库的安装包,然后安装:

    已加载插件:fastestmirror
    Loading mirror speeds from cached hostfile
     * base: mirror.vpshosting.com.hk
     * extras: mirror.vpshosting.com.hk
     * updates: mirror.vpshosting.com.hk
    libXtst-1.2.3-1.el7.i686 : X.Org X11 libXtst runtime library
    源    :base
    匹配来源:
    提供    :libXtst.so.6
    
    
    
    libXtst-1.2.3-1.el7.i686 : X.Org X11 libXtst runtime library
    源    :@base
    匹配来源:
    提供    :libXtst.so.6
    

    安装 libXtst-1.2.3-1.el7.i68 这个库,也就说明安装了 libXtst.so.6。

    *** 但是,没有用。那么,大家平时都是怎么安装的呢?***

    2 条回复    2018-08-28 22:09:34 +08:00
    wqsfree
        1
    wqsfree  
       2018-08-28 16:07:44 +08:00
    yum list available | grep libXtst
    julyclyde
        2
    julyclyde  
       2018-08-28 22:09:34 +08:00
    你这个做法看起来没啥问题
    我觉得你是不是可以先 ldd 一下 /home/wwwroot/topsi-project-manager/node_modules/electron/dist/electron
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5418 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 07:37 · PVG 15:37 · LAX 00:37 · JFK 03:37
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.