11

I need to install readline on a linux server. since I don't have sudo access, I tried this instruction. And I got into problem.

I've installed readline by using ./configure, make, make install. At the end it ask me install: you may need to run ldconfig.

10

I've installed readline by using ./configure, make, make install. At the end it ask me install: you may need to run ldconfig.

So you just need to run the command

sudo ldconfig

What is ldconfig

ldconfig is a program that is used to maintain the shared library cache. This cache is typically stored in the file /etc/ld.so.cache and is used by the system to map a shared library name to the location of the corresponding shared library file

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.

For more information see : What-does-ldconfig-do?


UPDATE: solution for -bash: ldconfig: command not found

As told in comments below when you ran the echo $PATH gives

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

while ldconfig is inside /sbin which is outside the PATH, so you have then either to run the commands by absolute path like /sbin/ldconfig or correct your path.

To correct your PATH do the following:

gedit ~/.bashrc

add the line

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

Now save and exit then source .bashrc

source .bashrc

So now you can use the commands directly

  • I'm running these commands on a server and I don't have root access. It's not possible to run sudo ldconfig and when I executed ldconfig command , it said -bash: ldconfig: command not found – Mehrshad Jun 2 '15 at 10:50
  • output of ldconfig --version? – Maythux Jun 2 '15 at 10:52
  • -bash: ldconfig: command not found – Mehrshad Jun 2 '15 at 10:54
  • what is the output of the command echo $PATH – Maythux Jun 2 '15 at 10:56
  • /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games – Mehrshad Jun 2 '15 at 10:58

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.