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

Following the indications found here: https://switch2osm.org/serving-tiles/manually-building-a-tile-server-ubuntu-22-04-lts/ 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: https://askubuntu.com/questions/950313/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?

Related

Homebrew error: "ruby#2.7 is not a valid keg"

Every time I try to install or uninstall something using Homebrew, I got an error below.
"Error: /usr/local/opt/ruby#2.7 is not a valid keg"
I checked symlink by typing "ls -ld /usr/local/opt /usr/local/opt/ruby#2.7", and got results below.
drwxrwxr-x 183 aiden0206 admin 5856 10 3 20:53 /usr/local/opt
lrwxr-xr-x 1 aiden0206 admin 24 10 3 20:53 /usr/local/opt/ruby#2.7 -> ../Cellar/ruby#2.7/2.7.4
There seems to be no problem. The ruby#2.7 in /usr/local/opt correctly points to the /Cellar directory. Is there any other cause of the problem?
Thank you.

I get this error "can't decompress data; zlib not available" when installing AWS EB CLI on MacOS 10.15

I am trying to install AWS Elastic Beanstalk CLI (https://github.com/aws/aws-elastic-beanstalk-cli-setup) but am having the the greatest trouble understanding why it doesn't work (I'm not good with this kind of stuff so it might be something easy..)
I've followed all the setup instructions but I get the following output and error when I run this command ./aws-elastic-beanstalk-cli-setup/scripts/bundled_installer:
==============================================
I. Installing Python
==============================================
*************************************************************
1. Determining whether pyenv is already installed and in PATH
*************************************************************
- pyenv was not found in PATH.
*********************************************************
2. Determining whether pyenv should be cloned from GitHub
*********************************************************
- pyenv git repository already cloned to /Users/apple/.pyenv-repository. Won't attempt to clone again.
*******************************************
3. Temporarily export necessary pyenv paths
*******************************************
****************************************************************************
4. Checking whether Python can be downloaded (through curl, wget, or aria2c)
****************************************************************************
************************************************************
5. Installing Python 3.7.2. This step may take a few minutes
************************************************************
python-build: use openssl from homebrew
python-build: use readline from homebrew
Downloading Python-3.7.2.tar.xz...
-> https://www.python.org/ftp/python/3.7.2/Python-3.7.2.tar.xz
Installing Python-3.7.2...
python-build: use readline from homebrew
BUILD FAILED (OS X 10.15.2 using python-build 20180424)
Inspect or clean up the working tree at /var/folders/t9/6kkmnhns6g9192p5r2zwmf640000gn/T/python-build.20200204155232.99457
Results logged to /var/folders/t9/6kkmnhns6g9192p5r2zwmf640000gn/T/python-build.20200204155232.99457.log
Last 10 log lines:
File "/private/var/folders/t9/6kkmnhns6g9192p5r2zwmf640000gn/T/python-build.20200204155232.99457/Python-3.7.2/Lib/ensurepip/__main__.py", line 5, in <module>
sys.exit(ensurepip._main())
File "/private/var/folders/t9/6kkmnhns6g9192p5r2zwmf640000gn/T/python-build.20200204155232.99457/Python-3.7.2/Lib/ensurepip/__init__.py", line 204, in _main
default_pip=args.default_pip,
File "/private/var/folders/t9/6kkmnhns6g9192p5r2zwmf640000gn/T/python-build.20200204155232.99457/Python-3.7.2/Lib/ensurepip/__init__.py", line 117, in _bootstrap
return _run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
File "/private/var/folders/t9/6kkmnhns6g9192p5r2zwmf640000gn/T/python-build.20200204155232.99457/Python-3.7.2/Lib/ensurepip/__init__.py", line 27, in _run_pip
import pip._internal
zipimport.ZipImportError: can't decompress data; zlib not available
make: *** [install] Error 1
Exiting due to failure
I have the following in my .zshrc file:
CFLAGS="-I$(brew --prefix openssl)/include -I$(brew --prefix readline)/include -I$(xcrun --show-sdk-path)/usr/include"
LDFLAGS="-L$(brew --prefix openssl)/lib -L$(brew --prefix readline)/lib -L$(brew --prefix zlib)/lib"
CPPFLAGS="-I$(brew --prefix openssl)/include -I$(brew --prefix zlib)/include"
So I have no idea what is going on...
The only thing that could explain this is the following message I get when installing zlib with brew:
==> Caveats
zlib is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.
But then when go to /usr/local/opt in can see zlib as a symlink so I don't understand..
$ ll /usr/local/opt/
total 0
lrwxr-xr-x 1 apple admin 28B Feb 4 14:43 openssl -> ../Cellar/openssl#1.1/1.1.1d
lrwxr-xr-x 1 apple admin 28B Feb 4 14:43 openssl#1.1 -> ../Cellar/openssl#1.1/1.1.1d
lrwxr-xr-x 1 apple admin 21B Feb 4 15:13 zlib -> ../Cellar/zlib/1.2.11
...
You can try installing the EB CLI via Homebrew. This worked in my case whereas the other methods detailed here did not.

Bash on Ubuntu on Windows can't use `sudo apt-get install <packagename>`

I was excited to use bash on windows but quickly ran into an issue. I am trying to install build-essential, but I get a dependency issue. Upon trying to resolve with sudo apt-get install -f, I run into another error that doesn't make much sense. I've tried update and upgrade, but that didn't work either. F
barzevp#UK-LT-8356:~$ sudo apt-get install build-essential
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version.
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies.
libc6-dev : Depends: linux-libc-dev but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
barzevp#UK-LT-8356:~$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
libfreetype6 os-prober
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
linux-libc-dev
The following NEW packages will be installed
linux-libc-dev
0 to upgrade, 1 to newly install, 0 to remove and 43 not to upgrade.
5 not fully installed or removed.
Need to get 0 B/767 kB of archives.
After this operation, 3,946 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 28660 files and directories currently installed.)
Preparing to unpack .../linux-libc-dev_3.13.0-123.172_amd64.deb ...
Unpacking linux-libc-dev:amd64 (3.13.0-123.172) ...
dpkg: error processing archive /var/cache/apt/archives/linux-libc-dev_3.13.0-123.172_amd64.deb (--unpack):
unable to install new version of /usr/include/linux/netfilter_ipv6/ip6t_hl.h': File exists
E: Sub-process /usr/bin/dpkg returned an error code (1)
Full log of what led to the error in Bash on Ubuntu on Windows terminal is here:
https://pastebin.com/dq2D2Gtz
I don't have a solution, but I see the root of the problem. It seems to have to do with case sensitivity on the filesystem. The package for linux-libc-dev puts two copies of a file in /usr/include/linux/netfilter_ipv6 with only a difference in case; ip6t_HL.h, and ip6t_hl.h. After placing ip6t_HL.h, it attempts to rename ip6t_hl.h.dpkg-new to ip6t_hl.h. The system call to rename the file fails, claiming that ip6t_hl.h already exists
On a "real" linux system, ip6t_HL.h and ip6t_hl.h would clearly be different files. Under WSL they probably had some strange incompatibilities to work out between NTFS's default case insensitive FS and unix's default case sensitivity.
You can duplicate the problem by hand e.g., with
echo hi > foo.H
echo hi > foo.h-new
mv foo.h-new foo.h
mv: cannot move 'foo.h-new' to 'foo.h': File exists
strace output:
rename("/usr/include/linux/netfilter_ipv6/ip6t_HL.h.dpkg-new", "/usr/include/linux/netfilter_ipv6/ip6t_HL.h") = 0
open("/usr/include/linux/netfilter_ipv6/ip6t_hl.h.dpkg-new", O_WRONLY) = 10
fsync(10) = 0
close(10) = 0
rename("/usr/include/linux/netfilter_ipv6/ip6t_hl.h.dpkg-new", "/usr/include/linux/netfilter_ipv6/ip6t_hl.h") = -1 EEXIST (File exists)
write(2, "dpkg: error processing archive /"..., 199dpkg: error processing archive /var/cache/apt/archives/linux-libc-dev_4.4.0-98.121_amd64.deb (--install):
unable to install new version of '/usr/include/linux/netfilter_ipv6/ip6t_hl.h': File exists
) = 199
I had the same problem. Like #dmattp I found that it this is because, unfortunately, the package contains some (header) files with names that are distinct only by letter case, and that the wonderful WSL file system has an inconsistency regarding case sensitiveness.
Here is a workaround, assuming that the package has name linux-libc-dev_3.13.0-123.172_amd64.deb:
cd any-temp-dir
apt-get download linux-libc-dev
ar x linux-libc-dev_3.13.0-123.172_amd64.deb
tar xJf data.tar.xz # ignore all erors like ./usr/include/linux/netfilter_ipv4/ipt_ttl.h: Cannot open: Input/output error
tar cJf data.tar.xz ./usr
ar rcs linux-libc-dev_3.13.0-123.172_amd64-patched.deb debian-binary control.tar.gz data.tar.xz
sudo dpkg -i linux-libc-dev_3.13.0-123.172_amd64-patched.deb
It says dependencies aren't being installed, so try:
sudo apt-get install linux-libc-dev
If that doesn't work try:
sudo apt-get install --reinstall build-essential
This will reinstall build-essential. Hope this helps, cheers!

Reinstall libprotobuf.so files in /usr/lib/x86_64-linux-gnu

While encountering problems updating protobuf to 3.1 I foolishly ended up removing the libprotbuf* files in /usr/lib/x86_64-linux-gnu
Fortunately Protoc --version now outputs "libprotoc 3.1.0", but I am now trying to get the libprotobuf.so files back. When trying to use things that link to protobuf like matplotlib.pyplot I get an error like
** (process:15246): WARNING **: Failed to load shared library 'libgdk-3.so.0' referenced by the typelib: libprotobuf-lite.so.9: cannot open shared object file: No such file or directory
I have been able to reinstall some of libprotobuf files but the .so files are still missing.
$ ll /usr/lib/x86_64-linux-gnu/libprotobuf*
-rw-r--r-- 1 root root 2.3M Oct 23 2015 /usr/lib/x86_64-linux-gnu/libprotobuf.a
-rw-r--r-- 1 root root 387K Oct 23 2015 /usr/lib/x86_64-linux-gnu/libprotobuf-lite.a
lrwxrwxrwx 1 root root 25 Oct 23 2015 /usr/lib/x86_64-linux-gnu/libprotobuf-lite.so -> libprotobuf-lite.so.9.0.1
lrwxrwxrwx 1 root root 20 Oct 23 2015 /usr/lib/x86_64-linux-gnu/libprotobuf.so -> libprotobuf.so.9.0.1
Anyone know a way to recover the protobuf.so.9.0.1 and libprotobuf-lite.so.9.0.1 files in ubuntu 16.04?
Build Protobuf 2.6.1 version. After building this version it will create libprotobuf.so.9.0.1 and libprotobuf-lite.so.9.0.1.
download the right protobuf version, build it yourself, and you will be just fine.
the original so and the so you are going to build should be the same, the later one will work just fine.

Unable to serve pages on Mac OS X using default Apache Web Server

I have enabled the Web Server on my Mac OS X (10.5.6) by going to the System Preferences -> Internet & Network -> Sharing and clicking on the Web Server option. It gives me the IP address of my system as the Web Server, but even after clicking on it, it does not show the page, but gives an error: Failed to Connect
Any help on this would be wonderful.
I have tried with MAMP, but there, I am unable to get my own PHP pages to be displayed.
Starting and/or stopping the web server from the command line, gives me the following:
dyld: Symbol not found: _apr_socket_sendfile
Referenced from: /usr/sbin/httpd
Expected in: /usr/lib/libapr-1.0.dylib
Trace/BPT trap
The files on my box are:
~ $ ls -lrt /usr/lib/libapr*
-rwxr-xr-x 1 root wheel 578640 Sep 23 2007 /usr/lib/libapr-1.0.2.7.dylib
-rwxr-xr-x 1 root wheel 393696 Sep 23 2007 /usr/lib/libaprutil-1.0.2.7.dylib
-rwxrwxr-x 1 root admin 569544 Oct 27 10:44 /usr/lib/libaprutil-1.0.2.12.dylib
-rwxrwxr-x 1 root admin 835824 Oct 27 10:44 /usr/lib/libapr-1.0.2.12.dylib
lrwxr-xr-x 1 root admin 25 Jan 4 22:28 /usr/lib/libaprutil-1.dylib -> libaprutil-1.0.2.12.dylib
lrwxr-xr-x 1 root admin 25 Jan 4 22:28 /usr/lib/libaprutil-1.0.dylib -> libaprutil-1.0.2.12.dylib
lrwxr-xr-x 1 root admin 21 Jan 4 22:28 /usr/lib/libapr-1.dylib -> libapr-1.0.2.12.dylib
lrwxr-xr-x 1 root admin 21 Jan 4 22:28 /usr/lib/libapr-1.0.dylib -> libapr-1.0.2.12.dylib
The MD5 values are:
~ $ openssl md5 /usr/sbin/httpd /usr/lib/libapr-1.0.dylib
MD5(/usr/sbin/httpd)= d5194790e9cfaca881d0e8fc3db24889
MD5(/usr/lib/libapr-1.0.dylib)= f7f7fd3cd315ca4e7c6ad2a2f222998e
The libapr-1.0.dylib is linked to the newer 1.0.2.12 version.
I'm having a similar problem and got to this page cause I feel lucky today :)
The error means the httpd binary makes reference to a symbol that cannot be found in the appropriate dynamically linked library (libapr in this case, Apache Runtime Library)
Running same OS X version on an iMac. /usr/lib/libapr-1.0.dylib points to the most recent version of the library (1.0.2.12), which does not define the method/symbol _apr_socket_sendfile
The other version of libapr library is 1.0.2.7, does have that symbol. I had the symbolic links point to this version instead (also for libaprutil):
// BEFORE (both 1.0.2.7 and 1.0.2.12 versions exist, symlinks point to .12)
bash-3.2# ls -l libapr*
-rwxr-xr-x 2 userna wheel 835824 19 Sep 2008 libapr-1.0.2.12.dylib
-rwxr-xr-x 1 root wheel 578640 24 Sep 2007 libapr-1.0.2.7.dylib
lrwxrwxrwx 1 root wheel 21 14 Oct 2008 libapr-1.0.dylib -> libapr-1.0.2.12.dylib
lrwxrwxrwx 1 root wheel 21 14 Oct 2008 libapr-1.dylib -> libapr-1.0.2.12.dylib
-rwxr-xr-x 2 userna wheel 569544 19 Sep 2008 libaprutil-1.0.2.12.dylib
-rwxr-xr-x 1 root wheel 393696 24 Sep 2007 libaprutil-1.0.2.7.dylib
lrwxrwxrwx 1 root wheel 25 14 Oct 2008 libaprutil-1.0.dylib -> libaprutil-1.0.2.12.dylib
lrwxrwxrwx 1 root wheel 25 14 Oct 2008 libaprutil-1.dylib -> libaprutil-1.0.2.12.dylib
// CHANGE symbolic links to previous version
bash-3.2# ln -sf libapr-1.0.2.7.dylib libapr-1.0.dylib
bash-3.2# ln -sf libapr-1.0.2.7.dylib libapr-1.dylib
bash-3.2# ln -sf libaprutil-1.0.2.7.dylib libaprutil-1.0.dylib
bash-3.2# ln -sf libaprutil-1.0.2.7.dylib libaprutil-1.dylib
// TESTing whether httpd is loaded and run
bash-3.2# /usr/sbin/httpd -t
Syntax OK
Not really sure whether this has been broken since last software update that included Apache Web Server, I rarely use it on this box.
Hope it helps ;)
Jon
Maybe there are errors in the apache configuration.
If you disable the webserver in the System preferences and open a terminal you can check your configuration by typing:
httpd -t
If it gives a "Syntax OK" you're one step closer to a working webserver. Start the webserver manually by typing:
sudo httpd
If there are no errors, the webserver is started. Open a browser and check http://localhost. Sometimes an extra refresh (Command+R) is needed.
Stopping the server:
sudo httpd -k stop
If the manually starting works, but the System preferences version doesn't,
Check the /var/log/apache2/error_log for errors.
You can try to do the following:
1. backup current apache
sudo cp /usr/sbin/httpd /usr/sbin/httpd.old
2. Replace link in apache binary file to the old library:
sudo install_name_tool -change /usr/lib/libapr-1.0.dylib /usr/lib/libapr-1.0.2.7.dylib /usr/sbin/httpd
After it should work as expected and other applications will still use the new version of libapr
http://foundationphp.com/tutorials/php_leopard.php
I followed this on mine and it work perfectly.
Try to follow it a see if it works
If you're trying to access the pages from the computer itself just use http://localhost/. Also, try typing the IP address into the browser (instead of just clicking the link in the interface); don't ask me to explain why, but I've seen that make a difference.
Also make sure the OS's firewall is set to allow connections to Apache. "Personal Web Sharing" should be checked.
Have you installed the subversion 1.5 client on your machine? I am seeing the same problem and it seems to be down to this. /usr/lib/libapr-1.0.dylib is normally linked to /Developer/SDKs/MacOSX10.5.sdk/usr/lib/libapr-1.0.2.7.dylib but if you install svn 1.5 it gets re-linked to /opt/subversion/lib/libapr-1.0.2.12.dylib.
The 1.0.2.12 version of the library does not contain the symbol _apr_socket_sendfile.
Having found the problem I'm still trying to figure out how to solve it.
Doug
Stupid question. Does libapr-1.0.dylib exist?
On my Macbook, /usr/lib/libapr-1.0.dylib is a symbolic link to libapr-1.0.2.7.dylib.
Running nm against that file does show that apr_socket_sendfile is defined in that library.
Also: do standard html pages work properly?
It sounds like either:
The httpd that comes first in your path is not /usr/sbin/httpd, and it was built strangely, or
You have installed something that overwrote either httpd or libapr.
What's the MD5 of your httpd and libapr? I get:
$ openssl md5 /usr/sbin/httpd /usr/lib/libapr-1.0.dylib
MD5(/usr/sbin/httpd)= d5194790e9cfaca881d0e8fc3db24889
MD5(/usr/lib/libapr-1.0.dylib)= f1f5ece10140a5c2cea2fece7a9e4918

Resources