Error while loading shared libraries: libevent-2.0.so.5 - linux

After upgrade ubuntu 16 to 18. I got this error when execute tmux
tmux: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory
and here's result when I execute ldd $(which tmux)
linux-vdso.so.1 (0x00007ffd9878a000)
libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f5588dfc000)
libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5 (0x00007f5588bd2000)
libevent-2.0.so.5 => not found
libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f55889b7000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f55885c6000)
/lib64/ld-linux-x86-64.so.2 (0x00007f5588fff000

libevent-2.0.so.5 => not found
libevent-2.0-5 (xenial-updates) was repacked to compat-libevent2-5_2.0.21-1ubuntu18_amd64.deb : No conflicts with the Ubuntu 18.04 "libevent-2.1-6".
compat-libevent2-5 Provides /usrlib/libevent-2.0.so.5 -> libevent-2.0.so.5.1.9
Download link https://drive.google.com/file/d/1xG1a3GMZuLc1HIRYMP2vythuqjODmN8o/view?usp=sharing
Package install: sudo gdebi Downloads/compat-libevent2-5_2.0.21-1ubuntu18_amd64.deb

Related

How to help an executable find a shared library?

I'm trying to run RF-TrulyMagical, but it says:
error while loading shared libraries: libSM.so.6: cannot open shared object file: No such file or directory
I've tried re-installing the library and running apt-get update and ldconfig, but nothing's changed. The library is at /lib/x86_64-linux-gnu and that path was already listed (I didn't add it myself) in a file inside the /etc/ld.so.conf.d directory.
Output for ldd RF-TrulyMagical is:
linux-gate.so.1 (0xf7fa1000)
libSM.so.6 => not found
libICE.so.6 => not found
libXext.so.6 => /usr/lib/i386-linux-gnu/libXext.so.6 (0xf7f6f000)
libX11.so.6 => /usr/lib/i386-linux-gnu/libX11.so.6 (0xf7e25000)
libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xf7e20000)
librt.so.1 => /lib/i386-linux-gnu/librt.so.1 (0xf7e16000)
libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xf7df7000)
libstdc++.so.6 => /usr/lib/i386-linux-gnu/libstdc++.so.6 (0xf7c71000)
libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xf7b6f000)
libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xf7b51000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf7973000)
/lib/ld-linux.so.2 (0xf7fa2000)
libxcb.so.1 => /usr/lib/i386-linux-gnu/libxcb.so.1 (0xf7947000)
libXau.so.6 => /usr/lib/i386-linux-gnu/libXau.so.6 (0xf7943000)
libXdmcp.so.6 => /usr/lib/i386-linux-gnu/libXdmcp.so.6 (0xf793c000)
libbsd.so.0 => /lib/i386-linux-gnu/libbsd.so.0 (0xf7921000)
Somewhere it said I should install lib32-libsm, but apt-get says Unable to locate package.
I have no idea what to do. Thanks in advance. (I'm running Ubuntu 18.04.1, if that helps)
Might be a simple case of:
apt-get install libsm6:i386

How to fix 'Can't open libmsodbcsql-17.3.so.1.1'

In ubuntu 19.04 when working with Python3 in an anaconda environment with pyodbc 4.0.26 installed I get the Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib '/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.3.so.1.1' : file not found (0) (SQLDriverConnect)")!
Installed msodbcsql17 in ubuntu 19.04 like described here. I tried all the suggestions from here and here. I did the analysis like described here.
With pyodbc 4.0.26, it is possible to check the driver in the anaconda environment with python3 -c 'import pyodbc; print(pyodbc.drivers())' and got ['ODBC Driver 17 for SQL Server'].
After the analysis and the solutions from the links shown above, I still am not able to get a connection to work with MS-SQL and Python3. Please help me!
Edit:
...:~$ ldd /opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.3.so.1.1
linux-vdso.so.1
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1
libodbcinst.so.2 => /usr/lib/x86_64-linux-gnu/libodbcinst.so.2
libcrypto.so.1.0.0 => not found
libkrb5.so.3 => /usr/lib/x86_64-linux-gnu/libkrb5.so.3
libgssapi_krb5.so.2 => /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2
libssl.so.1.0.0 => not found
libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6
/lib64/ld-linux-x86-64.so.2
libltdl.so.7 => /usr/lib/x86_64-linux-gnu/libltdl.so.7
libk5crypto.so.3 => /usr/lib/x86_64-linux-gnu/libk5crypto.so.3
libcom_err.so.2 => /lib/x86_64-linux-gnu/libcom_err.so.2
libkrb5support.so.0 => /usr/lib/x86_64-linux-gnu/libkrb5support.so.0
libkeyutils.so.1 => /lib/x86_64-linux-gnu/libkeyutils.so.1
libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2
Also:
~$ sudo locate libcrypto.so.1.0.0
/home/xxx/anaconda3/pkgs/openssl-1.0.2o-h20670df_0/lib/libcrypto.so.1.0.0
/home/xxx/anaconda3/pkgs/openssl-1.0.2p-h14c3975_0/lib/libcrypto.so.1.0.0
/home/xxx/anaconda3/pkgs/openssl-1.0.2p-h470a237_1/lib/libcrypto.so.1.0.0
and:
~$ sudo locate libssl.so.1.0.0
/home/xxx/anaconda3/pkgs/openssl-1.0.2o-h20670df_0/lib/libssl.so.1.0.0
/home/xxx/anaconda3/pkgs/openssl-1.0.2p-h14c3975_0/lib/libssl.so.1.0.0
/home/xxx/anaconda3/pkgs/openssl-1.0.2p-h470a237_1/lib/libssl.so.1.0.0
And I am working in Anaconda environment.
Installing libssl1.0.0 manually in Ubuntu 19.04 solves the problem, maybe with some other tuning I have done before - see the links mentioned in my question above. You can install the old lib in ubuntu 19.04 with wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl1.0/libssl1.0.0_1.0.2n-1ubuntu6.2_amd64.deb && dpkg -i libssl1.0.0_1.0.2n-1ubuntu6.2_amd64.deb. It will be installed parallel to libssl1.1.
As of 2019-05-22 Microsoft's installation instructions have not been updated to include Ubuntu 19.04. Microsoft has added an entry for 19.04 in the repository, i.e.,
https://packages.microsoft.com/config/ubuntu/19.04/prod.list
but it may not be ready for prime-time. It certainly looks like they need to sort out the libssl dependency for 19.04 since libssl1.0.0 is apparently no longer available
gord#VBox-Xubuntu1904:~$ sudo apt install libssl1.0.0
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package libssl1.0.0 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'libssl1.0.0' has no installation candidate

Error in libgraph installation :- missing libgraph.so.1 file in fedora 27

./a.out: error while loading shared libraries: libgraph.so.1: cannot open shared object file: No such file or directory.
ldd a.out :-inux-vdso.so.1 (0x00007ffc5bff4000) libgraph.so.1 => not found libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007fa242377000) libm.so.6 => /lib64/libm.so.6 (0x00007fa242022000) libgccs.so.1 => /lib64/libgccs.so.1 (0x00007fa241e0b000) libc.so.6 => /lib64/libc.so.6 (0x00007fa241a28000) /lib64/ld-linux-x86-64.so.2 (0x00007fa2426fe000).
here i can see that libgraph.so.1 is missing what shall i do further to get that missing file.
I had this problem even with the correct libraries installed.
Try this:
sudo cp /usr/local/lib/libgraph.* /usr/lib
and compile and run again.

How to check if my cross compiled executable is dynamic or static?

I used crosstools-ng to compile shadowsocks for my router, on my router, I can just ldd myExecutable to list the dependencies,
$ ssh root#my-router-ip
root#unknown:/tmp/home/root# ldd ./ss-server
libcrypto.so.1.0.0 => /usr/lib/libcrypto.so.1.0.0 (0x2aabf000)
libm.so.0 => /lib/libm.so.0 (0x2ac23000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x2ac37000)
libpthread.so.0 => /lib/libpthread.so.0 (0x2ac56000)
libc.so.0 => /lib/libc.so.0 (0x2ac78000)
libdl.so.0 => /lib/libdl.so.0 (0x2accb000)
ld-uClibc.so.0 => /lib/ld-uClibc.so.0 (0x2aaa8000)
but right now I don't have my router with me, how do I check it?
tried with the tools from crosstools-ng compiled toolchain which used to compile the executable
$ mipsel-unknown-linux-uclibc-ldd /home/oglop/Downloads/ss-install/bin/ss-server
mipsel-unknown-linux-uclibc-ldd: no root given
Try `mipsel-unknown-linux-uclibc-ldd --help' for more information
$ mipsel-unknown-linux-uclibc-readelf -d /home/oglop/Downloads/ss-install/bin/ss-server
There is no dynamic section in this file.
I have already tried methods here in How to list library dependencies of a non-native binary?, none of them works.

Page-break-inside support in phantomjs on heroku

I have a NodeJS app using PhantomJS to generate PDF files. My app is deployed to Heroku and I'm using this phantom build pack. Unfortunately this build pack does not support the page-break-inside: avoid CSS property.
I did a research and found 2 hacks on this GitHub issue page. I've tried both of them, but unfortunately I can't use the CSS one, due to my page structure and the JavaScript one isn't page-breaking properly.
One of the guys in the GitHub link above mentioned that this problem is fixed if I compile from source, but I have no idea how I can compile from source on Heroku App and is it even possible. All the buildpacks I found are using the binaries.
It's really important for my app to break pages properly, but I can't find a way to get this feature working. Any suggestion/guide about how to fix my issue will be greatly appreciated!
I've downloaded it to my machine(Debian 7.6.0) and compiled PhantomJS using this guide.
So I executed:
sudo apt-get update
sudo apt-get install build-essential chrpath git-core libssl-dev libfontconfig1-dev libxft-dev
git clone git://github.com/ariya/phantomjs.git
cd phantomjs
git checkout 1.9
./build.sh
And then I took the binary from /bin folder and added it to custom buildpack. I added this buildpack to heroku, but it crashed with the following error:
/phantomjs: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by ./phantomjs)
So I did on my machine
ldd bin/phantomjs
and I took all dependencies:
root#deepsypotato:/home/viktor# ldd phantomjs.1
linux-vdso.so.1 => (0x00007fffe9f74000)
libfreetype.so.6 => /usr/lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007fd914fcd000)
libfontconfig.so.1 => /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007fd914d96000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fd914b91000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fd914989000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fd91476d000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fd914465000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fd9141e3000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fd913fcd000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fd913c41000)
/lib64/ld-linux-x86-64.so.2 (0x00007fd915283000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fd913a2a000)
libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007fd913800000)
then I copied libstdc++.so.6 from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 and added it to my custom buildpack and now its working flawlessly :).

Resources