error while loading shared libraries: libhwloc.so.5: cannot open shared object file: No such file or directory

created at 11-11-2021 views: 53

I encountered this problem when installing a service:

error while loading shared libraries: libhwloc.so.5: cannot open shared object file: No such file or directory

Encountered it twice, once on the Ubuntu 18 system and once on the Ubuntu 20 system.

solution

# This step must not be less
sudo apt-get install -y libhwloc-dev

# Treatment method one
sudo ln -s /usr/lib/x86_64-linux-gnu/libhwloc.so.5.7.6 /usr/lib/x86_64-linux-gnu/libhwloc.so.15

# Treatment method two
sudo ln -s /usr/lib/x86_64-linux-gnu/libhwloc.so /usr/lib/x86_64-linux-gnu/libhwloc.so.5

When I encountered this problem for the first time, it was normal after executing the order of solution one.

But the second time I change the system, and then use the command of the solution one, an error will still be reported. So I went to look for files in the /usr/lib/x86_64-linux-gnu directory, and found that there was indeed no libhwloc.so.5 file, which felt quite outrageous. The installation package has been installed normally, but the command is not installed, so I am convinced. I checked it several times on the Internet, but there was no answer, so I tried to forcefully add a libhwloc.so.5 file, which is to create a soft link. I didn't expect it to work.

Simply make a record, and friends who have encountered similar problems can try.

created at:11-11-2021
edited at: 11-11-2021: