I am pretty new in Linux and I have some doubt related to this operation that I have found into a bash script on which I am working:

ldconfig -v >> /dev/null 2>&1

Reading on the man page of the ldconfig command I can read:

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).

What exactly mean? I am using Ubuntu system and in /etc/ld.so.conf I found:

 include /etc/ld.so.conf.d/*.conf

So I think that this line redirect me to all the .conf files into /etc/ld.so.conf.d/ directory

But I have some confusion...and many doubts:

1) What are contains into the .conf file?

2) what exactly do the command that is in my bash script?




Can't say without the full script, but if I were to guess, I would say that it is calling ldconfig to make sure that they latest shared libraries have been linked before the next part of the script executes.

Since there is no path specified, it will create any needed links based on the library internals (this will vary based on your distribution, whether you have installed anything new, what libraries you have installed).

If you want to see what it is doing specifically, just change the output path for stderr and stdout from /dev/null to a text file (/home/user/ldcheck.txt or similar) and examine the contents after the script runs.

As for the contents of ld.so.conf.d - that usually just contains default library path settings for things like libc.

This is all pretty standard stuff, so you might be better off mentioning what your actual issues here are, I doubt that ldconfig is the route cause of your problems, unless it is throwing errors of course.

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.