我该如何做“安装:您可能需要运行ldconfig”


11

我需要在Linux服务器上安装readline。由于我没有sudo访问权限,因此尝试了说明。而且我遇到了问题。

我已经通过使用安装的readline ./configuremakemake install。最后问我install: you may need to run ldconfig

Answers:


12

我已经使用安装了readline ./configure, make, make install。最后问我install: you may need to run ldconfig

所以你只需要运行命令

sudo ldconfig

什么是ldconfig

ldconfig是用于维护共享库高速缓存的程序。此缓存通常存储在文件中/etc/ld.so.cache,系统将其用于将共享库名称映射到相应共享库文件的位置

man ldconfig

 ldconfig - configure dynamic linker run-time bindings

DESCRIPTION
       ldconfig  creates,  updates,  and removes the necessary links and cache
       (for use by the run-time linker,  ld.so)  to  the  most  recent  shared
       libraries  found  in  the directories specified on the command line, in
       the file /etc/ld.so.conf, and in the trusted directories (/usr/lib  and
       /lib).   ldconfig  checks the header and file names of the libraries it
       encounters when determining which  versions  should  have  their  links
       updated.  ldconfig ignores symbolic links when scanning for libraries.

有关更多信息,请参见:做什么-ldconfig-do?


更新:解决方案 -bash: ldconfig: command not found

如以下评论所述,当您运行echo $PATH赠予时

/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games

while ldconfig位于/ sbin内(位于PATH之外),因此您必须按绝对路径(如)运行命令/sbin/ldconfig或更正路径。

要更正PATH,请执行以下操作:

gedit ~/.bashrc

添加线

export PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin

现在保存并退出然后源 .bashrc

source .bashrc

所以现在您可以直接使用命令


我正在服务器上运行这些命令,但没有root访问权限。无法运行sudo ldconfig,当我执行ldconfig命令时,它说-bash:ldconfig:命令未找到
Mehrshad 2015年

输出ldconfig --version
Maythux 2015年

-bash:ldconfig:找不到命令
Mehrshad

命令的输出是什么echo $PATH
Maythux 2015年

/ usr / local / bin:/ usr / bin:/ bin:/ usr / local / games:/ usr / games
Mehrshad
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.