Broken link? How to fix?

I am now seeing this message during an update in Ubuntu 20.04.

/sbin/ldconfig.real: /usr/lib/libhid.so.0 is not a symbolic link

How do I fix this? I have searched the net without finding a solution at this time.

Thanks.

First of all. Welcome to the community.

Try running “ldconfig -v” to find the link then you can ID the errant link.

Thanks, did that with a huge amount of data displayed and identified, how do I fix this ‘broken’ link?

Copy of part of the data displayed.
liblber-2.4.so.2 → liblber-2.4.so.2.10.12
/usr/local/lib:
/sbin/ldconfig.real: /usr/local/lib/libhid.so.0.0 is for unknown machine 40.

libcom.so -> libcom.so
liblunar.so -> liblunar.so

/sbin/ldconfig.real: /usr/local/lib/libhid.so.0 is not a symbolic link

libhid.so.0 -> libhid.so.0.0.0
libusbdll.so -> libusbdll.so

/usr/local/lib/x86_64-linux-gnu:
/lib/x86_64-linux-gnu:

The question is: Do you even need to bother?

ldconfig caches recently used libraries and the symbolic links to them.

Say, a program foo needs a certain library bar.1, but bar.1 gets updated, and hence gets a new name bar.2.
If you now run foo, it won’t find the library it needed and will crash.

In order to avoid this kind of problems, a symbolic link bar is created, which will always point to the current version bar.X.

ldconfig keeps a list of these most recently links in order to speed up access.

If during an update, the need for the library bar.X is removed, so is the symbolic link bar to the library bar.X, but the information about it is still stored in ldconfig's database and hence, it will complain about this missing link.

I make the educated guess that, after complaining, it will eventually remove the corresponding entry in its database after a certain time.

As long as bar is really not needed any more, everything’s fine, and you won’t get any further complaints during future updates.

However, when updating my system or a certain program, I often get the question:

The following packages/libraries/programs are no longer needed. Do you want to remove them? (y/n)

Seems sensible not to clutter your system with unused programs and libraries. So far the theory. In practice, I often found these x is no longer needed to be far too optimistic, and I had to reinstall stuff that was automatically removed.

So, as a matter of precaution, I always say no to automatic removals unless I’m absolutely sure. As I’m a hoarder and lazy by nature, I prefer keeping a few MB of useless data to having to reinstall accidentally deleted packages.