Score:0

libboost_filesystem.so.1.71.0: cannot open shared object file: No such file or directory

cn flag

Following the indications found here. I'm trying to install Tile Server in Ubuntu 22.04

but I'm getting this error:

raphy@pc:~$ sudo -u _renderd osm2pgsql -d gis --create --slim  -G --hstore --tag-transform-script ./OSM_src/openstreetmap-carto/openstreetmap-carto.lua -C 2500 --number-processes 1 -S ./OSM_src/openstreetmap-carto/openstreetmap-carto.style ./OSM_src/data/azerbaijan-latest.osm.pbf
osm2pgsql: error while loading shared libraries: libboost_filesystem.so.1.71.0: cannot open shared object file: No such file or directory

The libboost library present is 1.74.0:

raphy@pc:~$ sudo apt install libboost-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libboost-dev is already the newest version (1.74.0.3ubuntu7).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

raphy@pc:/usr/lib/x86_64-linux-gnu$ ls -lah | grep libboost_filesystem.so
lrwxrwxrwx   1 root root    29 mar 16  2022 libboost_filesystem.so -> libboost_filesystem.so.1.74.0
-rw-r--r--   1 root root  123K mar 16  2022 libboost_filesystem.so.1.74.0

Following the indications found here: How to set LD_LIBRARY_PATH permanently? I've set in .bashrc file:

LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu/libboost_filesystem.so"

And, following the indications found here: https://serverfault.com/questions/201709/how-to-set-ld-library-path-in-ubuntu I've set /etc/ld.so.conf.d/libboost.conf as :

/usr/lib/x86_64-linux-gnu/libboost_filesystem.so

And then

sudo ldconfig

But still get the error:

osm2pgsql: error while loading shared libraries: libboost_filesystem.so.1.71.0: cannot open shared object file: No such file or directory

How to solve the problem?

Score:2
eh flag

This error message indicates that the shared library libboost_filesystem.so.1.71.0 is not found. This is due to the fact that Ubuntu 22.04 ships with boost 1.74.0 and therefore only the file libboost_filesystem.so.1.74.0 exists. The libraries are found in /usr/lib/x86_64-linux-gnu.

A quick and dirty method was for me to add a symbolic link:

ln -s libboost_filesystem.so libboost_filesystem.so.1.71.0 

But keep in mind that this creates library inconsistencies because you want to execute code with the older library version and the newer version could have deleted something that the code breaks.

A cleaner approach would be the installation of the older boost version but this is not possible through apt because version 1.71 is for ubuntu 22.04 which is obsolete.

Raphael10 avatar
cn flag
Thank you @Simon
Siddharth Das avatar
cl flag
I added symbolic link but still getting the same error
Simon avatar
eh flag
@SiddharthDas Do you also use Ubuntu 22.04 and have boost 1.74 installed? Are the symbolic_links set correctly and is the error message completly identical as before?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.