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

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

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

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

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

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 :).

Running Ubuntu 12.04 compiled C++ Programs on a CentOS5 Box

I have a bunch of software developed on Linux in C++ using g++. The code compiles and runs on both Ubuntu 12.04 and CentOS 5. We have a few older servers still running CentOS 5. Currently I compile for both OSes. I want to start using some C++11 features. These are supported on Ubuntu 12.04 but not CentOS 5.
I am trying to produce executables on Ubuntu for CentOS. Toward that end I have linked all the executables with
-Wl,-rpath,/home/arcamax/lib
That should tell it to look in /home/arcamax/lib for shared libs before the standard locations. I then used 'ldd' on the Ubuntu box to build a list of needed libraries and copied those libs to /home/arcamax/lib on the CentOS box. When I try to run the programs on the CentOS box I get:
When I run ldd on the CentOS5 box I get output like this:
libcrypto.so.1.0.0 => /home/arcamax/lib/libcrypto.so.1.0.0 (0x00002b3557f54000)
libpq.so.5 => /home/arcamax/lib/libpq.so.5 (0x00002b355831c000)
libstdc++.so.6 => /home/arcamax/lib/libstdc++.so.6 (0x00002b3558548000)
libm.so.6 => /home/arcamax/lib/libm.so.6 (0x00002b3558849000)
libgcc_s.so.1 => /home/arcamax/lib/libgcc_s.so.1 (0x00002b3558b43000)
libc.so.6 => /home/arcamax/lib/libc.so.6 (0x00002b3558d59000)
libpthread.so.0 => /home/arcamax/lib/libpthread.so.0 (0x00002b3559117000)
libdl.so.2 => /home/arcamax/lib/libdl.so.2 (0x00002b3559334000)
libz.so.1 => /home/arcamax/lib/libz.so.1 (0x00002b3559538000)
libssl.so.1.0.0 => /home/arcamax/lib/libssl.so.1.0.0 (0x00002b3559750000)
libkrb5.so.3 => /home/arcamax/lib/libkrb5.so.3 (0x00002b35599ac000)
libcom_err.so.2 => /home/arcamax/lib/libcom_err.so.2 (0x00002b3559c7a000)
libgssapi_krb5.so.2 => /home/arcamax/lib/libgssapi_krb5.so.2 (0x00002b3559e7f000)
libldap_r-2.4.so.2 => /home/arcamax/lib/libldap_r-2.4.so.2 (0x00002b355a0bd000)
/lib64/ld-linux-x86-64.so.2 (0x00000035aa800000)
libk5crypto.so.3 => /home/arcamax/lib/libk5crypto.so.3 (0x00002b355a30d000)
libkrb5support.so.0 => /home/arcamax/lib/libkrb5support.so.0 (0x00002b355a535000)
libkeyutils.so.1 => /home/arcamax/lib/libkeyutils.so.1 (0x00002b355a73d000)
libresolv.so.2 => /home/arcamax/lib/libresolv.so.2 (0x00002b355a942000)
liblber-2.4.so.2 => /home/arcamax/lib/liblber-2.4.so.2 (0x00002b355ab5e000)
libsasl2.so.2 => /home/arcamax/lib/libsasl2.so.2 (0x00002b355ad6c000)
libgssapi.so.3 => /home/arcamax/lib/libgssapi.so.3 (0x00002b355af88000)
libgnutls.so.26 => /home/arcamax/lib/libgnutls.so.26 (0x00002b355b1c6000)
libgcrypt.so.11 => /home/arcamax/lib/libgcrypt.so.11 (0x00002b355b482000)
libheimntlm.so.0 => /home/arcamax/lib/libheimntlm.so.0 (0x00002b355b701000)
libkrb5.so.26 => /home/arcamax/lib/libkrb5.so.26 (0x00002b355b908000)
libasn1.so.8 => /home/arcamax/lib/libasn1.so.8 (0x00002b355bb8e000)
libhcrypto.so.4 => /home/arcamax/lib/libhcrypto.so.4 (0x00002b355be2f000)
libroken.so.18 => /home/arcamax/lib/libroken.so.18 (0x00002b355c063000)
libtasn1.so.3 => /home/arcamax/lib/libtasn1.so.3 (0x00002b355c278000)
libp11-kit.so.0 => /home/arcamax/lib/libp11-kit.so.0 (0x00002b355c48a000)
libgpg-error.so.0 => /home/arcamax/lib/libgpg-error.so.0 (0x00002b355c69c000)
libwind.so.0 => /home/arcamax/lib/libwind.so.0 (0x00002b355c8a0000)
libheimbase.so.1 => /home/arcamax/lib/libheimbase.so.1 (0x00002b355caca000)
libhx509.so.5 => /home/arcamax/lib/libhx509.so.5 (0x00002b355ccd9000)
libsqlite3.so.0 => /home/arcamax/lib/libsqlite3.so.0 (0x00002b355cf23000)
libcrypt.so.1 => /home/arcamax/lib/libcrypt.so.1 (0x00002b355d1c7000)
Note there is one lib, /lib64/ld-linux-x86-64.so.2, that is still being pulled from a system location. I don't know why that is. When I try to run the program I get:
relocation error: /home/arcamax/lib/libgnutls.so.26: symbol time, version GLIBC_2.2.5 not defined in file libc.so.6 with link time reference
A few of the programs fail ldd with the message:
not a dynamic executable
Those programs report the same error as the others when I try to run them.
Don't compile on the system with the newer glibc. It will be very difficult or impossible to run them on the machine with the older glibc.
Instead you should compile on the older CentOS system and the binaries will happily run on the newer system.
I want to start using some C++11 features. These are supported on Ubuntu 12.04 but not CentOS 5.
No, they're supported by the GCC version that happens to be installed on Ubuntu 12.04, they're not supported by "Ubuntu". Install the same GCC version on the CentOS host and you can use C++11 features when you compile there.
Installing GCC is easy, just read that wiki page, and don't try to replace your system compiler i.e. install to /usr/local or /opt or $HOME or somewhere other than /usr

Linux module dependency

We have a linux module developed by a 3rd party, now the module runs correctly on a Fedora system but on Ubuntu the same fails. When we do an ldd for the binary the following output is received
linux-gate.so.1 => (0xffffe000)
libdl.so.2 => /lib32/libdl.so.2 (0xf76f5000)
libc.so.6 => /lib32/libc.so.6 (0xf759b000)
/lib/ld-linux.so.2 (0xf7705000)
libutf16.so => not found
I am unable to find the library libutf16 for ubuntu, where can i find this library or is it part of a bigger library.
There is no file that contains libutf16 in its name in any package in Ubuntu 10.04.

Resources