ldconfig didn't remove a symlink when a library was deleted

5,469

ldconfig is completely depending on the specified config file you put in /etc/ld.so.conf.d or specified in /etc/ld.so.conf file.

If you delete some dynamic libraries which have already been cached in ldconfig, and then the symbol links which created by ldconfig will be deleted automatically if you ran the ldconfig after your deletion.

But if you delete your specified config file as well before you ran the ldconfig command, the broken symbol links can't be deleted.

Share:
5,469

Related videos on Youtube

FPanda
Author by

FPanda

Updated on September 18, 2022

Comments

  • FPanda
    FPanda over 1 year

    I made a specified config file which indicated my specified dynamic library path under /etc/ld.so.conf.d/ and ran the ldconfig command.

    After that, one symbolic link to my specified dynamic library was automatically generated. I guess it was the normal behaviour for ldconfig.

    The problem is that if I delete my config file which was put in /etc/ld.so.conf.d/ and my specified dynamic library, and then run the ldconfig command, the symbolic link wasn't deleted by ldconfig.

    I'd like to know if this was the normal behaviour for ldconfig and how can I work around this problem.

    • Zanna
      Zanna over 7 years
      Hmm I find some pages saying that ldconfig should remove symlinks when updating if appropriate but no clear examples...
    • FPanda
      FPanda over 7 years
      Would you like to share some of the links ? @Zanna
    • Zanna
      Zanna over 7 years
      here and here (halfway down - "How Do I Delete a Library Path?"
  • FPanda
    FPanda over 7 years
    So user should delete the symbol link by themselves? OMG...
  • mchid
    mchid over 7 years
    Sure, if you don't want them anymore and they are useless, go ahead and delete the symbolic links.