Problem scenario
You open a terminal window in Linux. You get an error like one of the following:
flatpak: /lib64/libldap_r-2.4.so.2: no version information available (required by /lib64/libcurl.so.4)
flatpak: error while loading shared libraries: libsasl2.so.2: cannot open shared object file: No such file or directory
What should you do?
Solution
(This solution will work if the file is in a different location from where it was expected on your server.)
1. Find if another copy of the file exists on your server. Run a command like this (but substitute "foobar.so.3" in the follow draft of a command with the file in the error message): sudo find / -name foobar.so.3
(replace "foobar.so.3" with the file you need)
2. Back up the file /lib64/foobar to another location. You may want to run "ls -lh /lib64/foobar" to see if it is merely a link to another file; if it is a link, just delete the link.
3. Copy the other copy of the file if it exists to /lib64/. Now the problem should go away.