0

I had a problem while trying to install glibc 2.14, I got this error

/home/myname/glibc_install/glibc-2.14/build/elf/ldconfig: Can't open configuration file /opt/glibc-2.14/etc/ld.so.conf: No such file or directory

The fix suggested this

:/opt/glibc-2.14/etc$ sudo sh -c "echo '/opt/lib' >> ld.so.conf"

AFAIK sudo sh -c "echo '/opt/lib' >> ld.so.conf" means open the sh program(the shell) and give it this command "echo '/opt/lib' >> ld.so.conf" to execute, which creates a file named ld.so.conf in the current directory and save in it /opt/lib, is that right ? what does the entire line means, or what the shell is going to do step by step ?

2 Answers 2

1

Breaking down the command: sudo sh -c "echo '/opt/lib' >> ld.so.conf" into bite size chunks:

sudo sh -c means to run shell command via the Bourne shell with super-user privileges.

echo '/opt/lib' >> ld.so.conf is going to APPEND whatever is inside the quotes + a \n (newline) char into ld.so.conf in the tail of the file.

2
  • Thank you, and what does :/opt/glibc-2.14/etc$ mean ?, because it is the part that I don't understand. Apr 18, 2019 at 19:05
  • 2
    That is just the person's terminal prompt output. Which varies from machine to machine depending on what is set for your environment's $PS1 variable. It is there before he starts typing anything, so it's superfluous to your issue and should be ignored.
    – Jaime
    Apr 18, 2019 at 19:10
1

Yes confusing) It looks like the first bit is the prompt (containing the working directory).

Therefore do

cd /opt/glibc-2.14/etc
sudo sh -c "echo '/opt/lib' >> ld.so.conf"

or

echo '/opt/lib' | sudo tee >/dev/null -a /opt/glibc-2.14/etc/ld.so.conf
2
  • Thanks, yes I will do that, if I didn't completely understand the line. Apr 18, 2019 at 18:36
  • OMG, I'm sorry I didn't notice the first part "It looks like the first bit is the prompt (containing the working directory)." , this should be the answer I just didn't notice it, i'm sorry. Apr 18, 2019 at 19:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .