Is it normal that LD_LIBRARY_PATH variable is missing from an environment?

Multi tool use
Multi tool use

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
14
down vote

favorite
3












I have found by coincidence that on my Debian Jessie there is no LD_LIBRARY_PATH variable (to be exact printenv | grep LD shows nothing related to linker and echo "$LD_LIBRARY_PATH" shows also nothing).



This is the case in x terminal emulator (which might clear it due to setgid) as well as in basic terminal (Ctrl+Alt+F1).



I know that LD_LIBRARY_PATH may be considered bad so Debian may block it somehow, but on the other hand there are a few files in /etc/ld.so.conf.d/ that contains some directories to be added to LD_LIBRARY_PATH. None of my rc files (that I know of) mess with LD_LIBRARY_PATH either.



Why I don't see an LD_LIBRARY_PATH variable?










share|improve this question



























    up vote
    14
    down vote

    favorite
    3












    I have found by coincidence that on my Debian Jessie there is no LD_LIBRARY_PATH variable (to be exact printenv | grep LD shows nothing related to linker and echo "$LD_LIBRARY_PATH" shows also nothing).



    This is the case in x terminal emulator (which might clear it due to setgid) as well as in basic terminal (Ctrl+Alt+F1).



    I know that LD_LIBRARY_PATH may be considered bad so Debian may block it somehow, but on the other hand there are a few files in /etc/ld.so.conf.d/ that contains some directories to be added to LD_LIBRARY_PATH. None of my rc files (that I know of) mess with LD_LIBRARY_PATH either.



    Why I don't see an LD_LIBRARY_PATH variable?










    share|improve this question

























      up vote
      14
      down vote

      favorite
      3









      up vote
      14
      down vote

      favorite
      3






      3





      I have found by coincidence that on my Debian Jessie there is no LD_LIBRARY_PATH variable (to be exact printenv | grep LD shows nothing related to linker and echo "$LD_LIBRARY_PATH" shows also nothing).



      This is the case in x terminal emulator (which might clear it due to setgid) as well as in basic terminal (Ctrl+Alt+F1).



      I know that LD_LIBRARY_PATH may be considered bad so Debian may block it somehow, but on the other hand there are a few files in /etc/ld.so.conf.d/ that contains some directories to be added to LD_LIBRARY_PATH. None of my rc files (that I know of) mess with LD_LIBRARY_PATH either.



      Why I don't see an LD_LIBRARY_PATH variable?










      share|improve this question















      I have found by coincidence that on my Debian Jessie there is no LD_LIBRARY_PATH variable (to be exact printenv | grep LD shows nothing related to linker and echo "$LD_LIBRARY_PATH" shows also nothing).



      This is the case in x terminal emulator (which might clear it due to setgid) as well as in basic terminal (Ctrl+Alt+F1).



      I know that LD_LIBRARY_PATH may be considered bad so Debian may block it somehow, but on the other hand there are a few files in /etc/ld.so.conf.d/ that contains some directories to be added to LD_LIBRARY_PATH. None of my rc files (that I know of) mess with LD_LIBRARY_PATH either.



      Why I don't see an LD_LIBRARY_PATH variable?







      linux environment-variables ld






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Sep 26 '17 at 11:21









      Kusalananda

      106k14209327




      106k14209327










      asked Sep 26 '17 at 11:04









      calavera.info

      291112




      291112




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          22
          down vote



          accepted










          Yes, it is normal that you don't have any explicit LD_LIBRARY_PATH. Read also ldconfig(8) and ld-linux(8) and about the rpath. Notice that ldconfig updates /etc/ld.so.cache, not the LD_LIBRARY_PATH. Sometimes you'll set the rpath of an executable explicitly with -Wl,-rpath,directory passed to gcc at link time.



          If you need a LD_LIBRARY_PATH (but you probably should not), set it yourself (e.g. in ~/.bashrc).



          If you need system wide settings, you could e.g. consider adding /usr/local/lib/ in /etc/ld.so.conf and run ldconfig after installation of every library there.



          AFAIK $LD_LIBRARY_PATH is used only by the dynamic linker ld-linux.so (and by dlopen(3) which uses it) after execve(2). See also ldd(1).



          Read Drepper's How To Write Shared Libraries for more.






          share|improve this answer






















          • That was my mistake, I though that LD_LIBRARY_PATH is the product of running ldconfig. Meanwhile it is the input of ldconfig alongside with files in /etc/ld.so.conf.
            – calavera.info
            Sep 26 '17 at 11:13






          • 1




            My feeling is that ldconfig don't use $LD_LIBRARY_PATH (which is only used at ld-linux.so time)
            – Basile Starynkevitch
            Sep 26 '17 at 11:15







          • 3




            @calavera.info it's neither. The dynamic linker uses LD_LIBRARY_PATH together with the output of ldconfig at runtime. ldconfig neither uses nor changes LD_LIBRARY_PATH.
            – hobbs
            Sep 26 '17 at 19:37










          • Now I can see that I had it totally messed up, probably by spending too much time in Java, where "classpath" is virtualy the only configuration of dynamic linking. Everything seems to be clear now, thanks a lot.
            – calavera.info
            Sep 27 '17 at 8:41










          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f394508%2fis-it-normal-that-ld-library-path-variable-is-missing-from-an-environment%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          22
          down vote



          accepted










          Yes, it is normal that you don't have any explicit LD_LIBRARY_PATH. Read also ldconfig(8) and ld-linux(8) and about the rpath. Notice that ldconfig updates /etc/ld.so.cache, not the LD_LIBRARY_PATH. Sometimes you'll set the rpath of an executable explicitly with -Wl,-rpath,directory passed to gcc at link time.



          If you need a LD_LIBRARY_PATH (but you probably should not), set it yourself (e.g. in ~/.bashrc).



          If you need system wide settings, you could e.g. consider adding /usr/local/lib/ in /etc/ld.so.conf and run ldconfig after installation of every library there.



          AFAIK $LD_LIBRARY_PATH is used only by the dynamic linker ld-linux.so (and by dlopen(3) which uses it) after execve(2). See also ldd(1).



          Read Drepper's How To Write Shared Libraries for more.






          share|improve this answer






















          • That was my mistake, I though that LD_LIBRARY_PATH is the product of running ldconfig. Meanwhile it is the input of ldconfig alongside with files in /etc/ld.so.conf.
            – calavera.info
            Sep 26 '17 at 11:13






          • 1




            My feeling is that ldconfig don't use $LD_LIBRARY_PATH (which is only used at ld-linux.so time)
            – Basile Starynkevitch
            Sep 26 '17 at 11:15







          • 3




            @calavera.info it's neither. The dynamic linker uses LD_LIBRARY_PATH together with the output of ldconfig at runtime. ldconfig neither uses nor changes LD_LIBRARY_PATH.
            – hobbs
            Sep 26 '17 at 19:37










          • Now I can see that I had it totally messed up, probably by spending too much time in Java, where "classpath" is virtualy the only configuration of dynamic linking. Everything seems to be clear now, thanks a lot.
            – calavera.info
            Sep 27 '17 at 8:41














          up vote
          22
          down vote



          accepted










          Yes, it is normal that you don't have any explicit LD_LIBRARY_PATH. Read also ldconfig(8) and ld-linux(8) and about the rpath. Notice that ldconfig updates /etc/ld.so.cache, not the LD_LIBRARY_PATH. Sometimes you'll set the rpath of an executable explicitly with -Wl,-rpath,directory passed to gcc at link time.



          If you need a LD_LIBRARY_PATH (but you probably should not), set it yourself (e.g. in ~/.bashrc).



          If you need system wide settings, you could e.g. consider adding /usr/local/lib/ in /etc/ld.so.conf and run ldconfig after installation of every library there.



          AFAIK $LD_LIBRARY_PATH is used only by the dynamic linker ld-linux.so (and by dlopen(3) which uses it) after execve(2). See also ldd(1).



          Read Drepper's How To Write Shared Libraries for more.






          share|improve this answer






















          • That was my mistake, I though that LD_LIBRARY_PATH is the product of running ldconfig. Meanwhile it is the input of ldconfig alongside with files in /etc/ld.so.conf.
            – calavera.info
            Sep 26 '17 at 11:13






          • 1




            My feeling is that ldconfig don't use $LD_LIBRARY_PATH (which is only used at ld-linux.so time)
            – Basile Starynkevitch
            Sep 26 '17 at 11:15







          • 3




            @calavera.info it's neither. The dynamic linker uses LD_LIBRARY_PATH together with the output of ldconfig at runtime. ldconfig neither uses nor changes LD_LIBRARY_PATH.
            – hobbs
            Sep 26 '17 at 19:37










          • Now I can see that I had it totally messed up, probably by spending too much time in Java, where "classpath" is virtualy the only configuration of dynamic linking. Everything seems to be clear now, thanks a lot.
            – calavera.info
            Sep 27 '17 at 8:41












          up vote
          22
          down vote



          accepted







          up vote
          22
          down vote



          accepted






          Yes, it is normal that you don't have any explicit LD_LIBRARY_PATH. Read also ldconfig(8) and ld-linux(8) and about the rpath. Notice that ldconfig updates /etc/ld.so.cache, not the LD_LIBRARY_PATH. Sometimes you'll set the rpath of an executable explicitly with -Wl,-rpath,directory passed to gcc at link time.



          If you need a LD_LIBRARY_PATH (but you probably should not), set it yourself (e.g. in ~/.bashrc).



          If you need system wide settings, you could e.g. consider adding /usr/local/lib/ in /etc/ld.so.conf and run ldconfig after installation of every library there.



          AFAIK $LD_LIBRARY_PATH is used only by the dynamic linker ld-linux.so (and by dlopen(3) which uses it) after execve(2). See also ldd(1).



          Read Drepper's How To Write Shared Libraries for more.






          share|improve this answer














          Yes, it is normal that you don't have any explicit LD_LIBRARY_PATH. Read also ldconfig(8) and ld-linux(8) and about the rpath. Notice that ldconfig updates /etc/ld.so.cache, not the LD_LIBRARY_PATH. Sometimes you'll set the rpath of an executable explicitly with -Wl,-rpath,directory passed to gcc at link time.



          If you need a LD_LIBRARY_PATH (but you probably should not), set it yourself (e.g. in ~/.bashrc).



          If you need system wide settings, you could e.g. consider adding /usr/local/lib/ in /etc/ld.so.conf and run ldconfig after installation of every library there.



          AFAIK $LD_LIBRARY_PATH is used only by the dynamic linker ld-linux.so (and by dlopen(3) which uses it) after execve(2). See also ldd(1).



          Read Drepper's How To Write Shared Libraries for more.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Sep 26 '17 at 11:19

























          answered Sep 26 '17 at 11:06









          Basile Starynkevitch

          7,9231940




          7,9231940











          • That was my mistake, I though that LD_LIBRARY_PATH is the product of running ldconfig. Meanwhile it is the input of ldconfig alongside with files in /etc/ld.so.conf.
            – calavera.info
            Sep 26 '17 at 11:13






          • 1




            My feeling is that ldconfig don't use $LD_LIBRARY_PATH (which is only used at ld-linux.so time)
            – Basile Starynkevitch
            Sep 26 '17 at 11:15







          • 3




            @calavera.info it's neither. The dynamic linker uses LD_LIBRARY_PATH together with the output of ldconfig at runtime. ldconfig neither uses nor changes LD_LIBRARY_PATH.
            – hobbs
            Sep 26 '17 at 19:37










          • Now I can see that I had it totally messed up, probably by spending too much time in Java, where "classpath" is virtualy the only configuration of dynamic linking. Everything seems to be clear now, thanks a lot.
            – calavera.info
            Sep 27 '17 at 8:41
















          • That was my mistake, I though that LD_LIBRARY_PATH is the product of running ldconfig. Meanwhile it is the input of ldconfig alongside with files in /etc/ld.so.conf.
            – calavera.info
            Sep 26 '17 at 11:13






          • 1




            My feeling is that ldconfig don't use $LD_LIBRARY_PATH (which is only used at ld-linux.so time)
            – Basile Starynkevitch
            Sep 26 '17 at 11:15







          • 3




            @calavera.info it's neither. The dynamic linker uses LD_LIBRARY_PATH together with the output of ldconfig at runtime. ldconfig neither uses nor changes LD_LIBRARY_PATH.
            – hobbs
            Sep 26 '17 at 19:37










          • Now I can see that I had it totally messed up, probably by spending too much time in Java, where "classpath" is virtualy the only configuration of dynamic linking. Everything seems to be clear now, thanks a lot.
            – calavera.info
            Sep 27 '17 at 8:41















          That was my mistake, I though that LD_LIBRARY_PATH is the product of running ldconfig. Meanwhile it is the input of ldconfig alongside with files in /etc/ld.so.conf.
          – calavera.info
          Sep 26 '17 at 11:13




          That was my mistake, I though that LD_LIBRARY_PATH is the product of running ldconfig. Meanwhile it is the input of ldconfig alongside with files in /etc/ld.so.conf.
          – calavera.info
          Sep 26 '17 at 11:13




          1




          1




          My feeling is that ldconfig don't use $LD_LIBRARY_PATH (which is only used at ld-linux.so time)
          – Basile Starynkevitch
          Sep 26 '17 at 11:15





          My feeling is that ldconfig don't use $LD_LIBRARY_PATH (which is only used at ld-linux.so time)
          – Basile Starynkevitch
          Sep 26 '17 at 11:15





          3




          3




          @calavera.info it's neither. The dynamic linker uses LD_LIBRARY_PATH together with the output of ldconfig at runtime. ldconfig neither uses nor changes LD_LIBRARY_PATH.
          – hobbs
          Sep 26 '17 at 19:37




          @calavera.info it's neither. The dynamic linker uses LD_LIBRARY_PATH together with the output of ldconfig at runtime. ldconfig neither uses nor changes LD_LIBRARY_PATH.
          – hobbs
          Sep 26 '17 at 19:37












          Now I can see that I had it totally messed up, probably by spending too much time in Java, where "classpath" is virtualy the only configuration of dynamic linking. Everything seems to be clear now, thanks a lot.
          – calavera.info
          Sep 27 '17 at 8:41




          Now I can see that I had it totally messed up, probably by spending too much time in Java, where "classpath" is virtualy the only configuration of dynamic linking. Everything seems to be clear now, thanks a lot.
          – calavera.info
          Sep 27 '17 at 8:41

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f394508%2fis-it-normal-that-ld-library-path-variable-is-missing-from-an-environment%23new-answer', 'question_page');

          );

          Post as a guest













































































          PUs1gjw4MfTBVo2N uSCNJ2iW ChWa4 UtnDhzVmyXK o2PW2zKfDG,o,meb3A,RIe9FKz5BFr2x
          IOetjuw62a,CEcpu3FCbYLZi,P

          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          How many registers does an x86_64 CPU actually have?

          Displaying single band from multi-band raster using QGIS