libcurl.so.4: cannot open shared object file: No such file or directory

ambikanair picture ambikanair · Jun 7, 2018 · Viewed 22.4k times · Source

I am creating binary of s3fs-fuse on Ubuntu 14.04 by following the compilation link. In some systems I get the below error while doing the mount operation on kubernetes pods

      ----     ------                 ----             ----                   -------
  Normal   Scheduled              5h               default-scheduler      Successfully assigned verifypod5 to 10.171.42.29
  Normal   SuccessfulMountVolume  5h               kubelet, 10.171.42.29  MountVolume.SetUp succeeded for volume "default-token-scrsz"
  Warning  FailedMount            5h (x8 over 5h)  kubelet, 10.171.42.29  MountVolume.SetUp failed for volume "pvc-f2d4cacc-6a51-11e8-b133-fa53da29538e" : mount command failed, status: Failure, reason: Error mounting volume: s3fs mount failed: s3fs: error while loading shared libraries: libcurl.so.4: cannot open shared object file: No such file or directory

I see that the binary is using libcurl-gnutls.so.4 but I feel we need the openssl one.

ldd /usr/local/bin/s3fs
linux-vdso.so.1 =>  (0x00007ffc3d1cb000)
libfuse.so.2 => /lib/x86_64-linux-gnu/libfuse.so.2 (0x00007fb0fd742000)
libcurl-gnutls.so.4 => /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4 (0x00007fb0fd4d5000)
libxml2.so.2 => /usr/lib/x86_64-linux-gnu/libxml2.so.2 (0x00007fb0fd11a000)
libcrypto.so.1.0.0 => /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 (0x00007fb0fccd6000)

So from the system where I did the building of binary, I see below

    dpkg -l | grep curl
ii  curl                                7.47.0-1ubuntu2.8                          amd64        command line tool for transferring data with URL syntax
ii  libcurl3:amd64                      7.47.0-1ubuntu2.8                          amd64        easy-to-use client-side URL transfer library (OpenSSL flavour)
ii  libcurl3-gnutls:amd64               7.47.0-1ubuntu2.8                          amd64        easy-to-use client-side URL transfer library (GnuTLS flavour)
ii  libcurl4-openssl-dev:amd64          7.47.0-1ubuntu2.8                          amd64        development files and documentation for libcurl (OpenSSL flavour)

So the binary picks up libcurl3-gnutls:amd64 instead of libcurl4-openssl-dev:amd64 . How can I change this behaviour.

Answer

matiit picture matiit · Jun 7, 2018

Please install libcurl3 package.

For the future, if you're missing some file, you can use https://packages.ubuntu.com to find what package provides a file you need.

For example: https://packages.ubuntu.com/search?searchon=contents&keywords=libcurl.so.4&mode=filename&suite=xenial&arch=any