LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-23-2018, 12:56 PM   #1
dsl_
Member
 
Registered: Jul 2008
Location: Denmark
Distribution: Debian
Posts: 71

Rep: Reputation: 0
ldconfig - Is this command present on all distros per default?


I seem to have read that it is run on boot, and every time new .so libraries are installed to keep the cache files updated. Specifically:

https://www.linuxquestions.org/quest...tartup-399220/

and, of course:

https://linux.die.net/man/8/ldconfig


I have a hard time seeing precisely where it fits into the Linux architecture. Can I trust this program to be present on any distribution?

I seem to remember having to install it manually as a libc6-tools package or something after a fresh install of Debian, which fits badly with it having to keep track of .so files.

Regards,
Soren
 
Old 06-23-2018, 01:01 PM   #2
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth, unfortunately...
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881

Rep: Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063Reputation: 2063
If it is on CentOS (which it is - as that's what I'm using right now), I'd say the answer is most likely yes. But I can't say that for 100% certainty.

But I personally would think it's a "standard command" - if there is such a thing of course.
 
Old 06-23-2018, 02:42 PM   #3
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,477
Blog Entries: 19

Rep: Reputation: 4409Reputation: 4409Reputation: 4409Reputation: 4409Reputation: 4409Reputation: 4409Reputation: 4409Reputation: 4409Reputation: 4409Reputation: 4409Reputation: 4409
ldconfig is part of libc as are one or two other commands (ldd comes to mind). However most binary distros put these utility commands into a separate package, usually called libc-bin.
 
2 members found this post helpful.
Old 06-24-2018, 06:30 AM   #4
dsl_
Member
 
Registered: Jul 2008
Location: Denmark
Distribution: Debian
Posts: 71

Original Poster
Rep: Reputation: 0
Yes. libc-bin was the one. So I cannot just assume it is always present. I find that a little funny given the documentation saying it is run automatically on boot and when installing new libraries.

Regards,
Soren
 
Old 06-24-2018, 06:47 AM   #5
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
linux being what it is, there's very little one can assume to be there always.

whatever you need this info for, you will need to add a test whether ldconfig is present, even if chances that it is NOT present are, like, 0.001%.
 
1 members found this post helpful.
Old 06-24-2018, 07:32 AM   #6
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,477
Blog Entries: 19

Rep: Reputation: 4409Reputation: 4409Reputation: 4409Reputation: 4409Reputation: 4409Reputation: 4409Reputation: 4409Reputation: 4409Reputation: 4409Reputation: 4409Reputation: 4409
I never heard of it not being present.
 
1 members found this post helpful.
Old 06-24-2018, 07:34 AM   #7
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; Slackware64-current (VM); Debian 12 (VM)
Posts: 8,272
Blog Entries: 61

Rep: Reputation: Disabled
Definitely in Slackware, must be run by root:
Code:
brian@slackdesk2:~$ ldconfig -V
bash: ldconfig: command not found
brian@slackdesk2:~$ su -
Password: 
root@slackdesk2:~# ldconfig -V
ldconfig (GNU libc) 2.23
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Andreas Jaeger.

Last edited by brianL; 06-24-2018 at 07:36 AM.
 
Old 06-24-2018, 09:40 AM   #8
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,477
Blog Entries: 19

Rep: Reputation: 4409Reputation: 4409Reputation: 4409Reputation: 4409Reputation: 4409Reputation: 4409Reputation: 4409Reputation: 4409Reputation: 4409Reputation: 4409Reputation: 4409
Quote:
Originally Posted by brianL View Post
Definitely in Slackware, must be run by root:
That's because it's not on your path. If you give the full pathname, you can run it as yourself.
Code:
$ ldconfig -V
bash: ldconfig: command not found
$ /sbin/ldconfig -V
ldconfig (GNU libc) 2.27
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Andreas Jaeger.
Mind you, that doesn't work if you want it to actually configure something.
Code:
$ /sbin/ldconfig
/sbin/ldconfig: Can't create temporary cache file /etc/ld.so.cache~: Permission denied
 
Old 06-24-2018, 09:40 AM   #9
dsl_
Member
 
Registered: Jul 2008
Location: Denmark
Distribution: Debian
Posts: 71

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by ondoho View Post
linux being what it is, there's very little one can assume to be there always.

whatever you need this info for, you will need to add a test whether ldconfig is present, even if chances that it is NOT present are, like, 0.001%.
I'm afraid this sums it up. I'll mark this thread as solved when I get home, off the "smart"-phone.

Thanks all,
Soren
 
Old 06-24-2018, 11:22 AM   #10
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; Slackware64-current (VM); Debian 12 (VM)
Posts: 8,272
Blog Entries: 61

Rep: Reputation: Disabled
The only time it would be necessary to run it manually, maybe, is if you installed a library in an unusual place (e.g. /opt), and edited /etc/ld.so.conf to show that.
 
Old 06-26-2018, 03:28 PM   #11
dsl_
Member
 
Registered: Jul 2008
Location: Denmark
Distribution: Debian
Posts: 71

Original Poster
Rep: Reputation: 0
So really, it boils down to ldconfig being there for the system as /sbin/ldconfig.

But if a user wants it he/she have to install libc-bin or equivalent. So, as odonho said:

We never really know. But something along the lines of 98% sure it's there as /sbin/ldconfig.

But we always have to check. Annoying.

/Regards
Soren
 
Old 07-01-2018, 09:12 AM   #12
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,922
Blog Entries: 44

Rep: Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158
Member response

Hi,

I suggest that you look at;Linux Documentation Project

You can find several references/examples to ldconfig. Just do a search on the LDP with 'ldconfig' as your key and you will find loads of information. Heck, even 'man ldconfig';
Quote:
ldconfig - configure dynamic linker run-time bindings

SYNOPSIS
/sbin/ldconfig [-nNvXV] [-f conf] [-C cache] [-r root] directory...
/sbin/ldconfig -l [-v] library...
/sbin/ldconfig -p

DESCRIPTION
ldconfig creates the necessary links and cache 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, /lib and /usr/lib (on some 64-bit architectures such as x86-64, lib and /usr/lib are the trusted directories
for 32-bit libraries, while /lib64 and /usr/lib64 are used for 64-bit libraries).

The cache is used by the run-time linker, ld.so or ld-linux.so. ldconfig checks the header and filenames of the libraries it encounters when determining which
versions should have their links updated.

ldconfig will attempt to deduce the type of ELF libraries (i.e., libc5 or libc6/glibc) based on what C libraries, if any, the library was linked against.

Some existing libraries do not contain enough information to allow the deduction of their type. Therefore, the /etc/ld.so.conf file format allows the specifi‐
cation of an expected type. This is used only for those ELF libraries which we can not work out. The format is "dirname=TYPE", where TYPE can be libc4,
libc5, or libc6. (This syntax also works on the command line.) Spaces are not allowed. Also see the -p option. ldconfig should normally be run by the supe‐
ruser as it may require write permission on some root owned directories and files.
Hope this helps.
Have fun & enjoy!
 
Old 07-01-2018, 11:39 AM   #13
Trasa
Member
 
Registered: Nov 2007
Posts: 63

Rep: Reputation: 26
iirc its been on ever distro i have ever used since '96.
 
Old 07-01-2018, 12:47 PM   #14
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
onebuck, what's with the huge fonts?
 
Old 07-01-2018, 01:40 PM   #15
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,922
Blog Entries: 44

Rep: Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158
Hi,

I did not change the font style or size. Looks normal to me.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
why procfs "/proc/sys/net/ipv4/neigh/default" directory is on present on a network namespace, created by "ip netns add NAME" command haldermi Linux - Networking 1 07-28-2016 03:26 PM
ldconfig: command not found upon sudo upgradepkg of glibc-zoneinfo thirdm Slackware 4 10-29-2014 11:20 AM
Which distros have no X or G.U.I. by default? punchy71 Linux - Newbie 12 09-10-2012 04:55 PM
The command ldconfig Gins Linux - General 3 10-04-2007 09:19 AM
ldconfig command not found Draylath Linux - Newbie 5 06-23-2004 04:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration