【发布时间】:2021-10-12 03:21:12
【问题描述】:
我使用 CentOS 7 并想使用一些需要 GLIBC_2.18 而主机操作系统仅提供 2.17 的 Anaconda python 包。我尝试按照这些instructions 自己编译更新版本的 glibc。当我尝试使用这个较新的 glibc 运行任何可执行文件时,我收到一个错误:
$ ./testrun.sh ls
ls: error while loading shared libraries: ls: cannot open shared object file: No such file or director
这个问题有解决办法吗?
更新 1:
根据answer 中的建议,我需要指定可执行文件的完整路径,这会给出不同的错误消息:
$ cd glibc-2.20/build # build directory
$ ./testrun.sh /bin/ls
/bin/ls: error while loading shared libraries: libselinux.so.1: cannot open shared object file: No such file or directory
更新 2:
在testrun.sh 中添加系统库的路径解决了这个问题。我不仅可以运行ls,还可以运行前面提到的python包。谢谢!
【问题讨论】:
-
你应该重建python包,而不是重建新的glibc。
-
谢谢,我之前确实尝试过构建这个包,但它有很多依赖项,有一次它失败了,我无法继续。所以我想尝试一个更简单的解决方案。
-
使用其他发行版或该软件包的旧版本。否则你会发现自己陷入了痛苦的世界。
-
我很想使用 Ubuntu/Debian,但不幸的是我被他们在工作中使用的 CentOS 卡住了。