3

I am trying to run a program, but when I execute it the following error appears :

./app: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by ./app)

At first I read to manually upgrade glibc but it seems too risky for a non-advanced user like me. A friend of mine told me about the chroot but I'm not sure about the steps which I must follow. Can anyone help me ?

Information of my system:

uname -a:Linux hostName 3.2.0-4-amd64 #1 SMP Debian 3.2.65-1+deb7u2 x86_64 GNU/Linux
Distro: Crunchbang 11 (Waldorf)
ldd --version: ldd (Debian EGLIBC 2.13-38+deb7u8) 2.13

ldd ./app:
  linux-vdso.so.1 =>  (0x00007ffdd593d000)
  libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007febe6450000)
  libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007febe623a000)
  libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007febe5eae000)
  libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007febe5c2c000)
   /lib64/ld-linux-x86-64.so.2 (0x00007febe677a000)

2 Answers 2

3

First of you need to realize that if you get message like this the application you trying to run is not meant to this platform/distribution. So, it's very likely that it'll crash in most painful way, taking all your files, money and house :)

Especially, this is related to the (g)libc, as it is closely tighten to the kernel ABI and running glibc compiled for the different version of ABI is risky. That's the reason behind library versioning.

If after all those warnings you still want to give it a try you can use, in the order of complexity, the following:

  1. Unpack appropriate library into the same catalogue, where your app is(or any other distinguished catalogue) and run the app like:

    LD_LIBRARY_PATH=. ./app
    

You can check the right library is picked up by testing with LD_LIBRARY_PATH=. ldd ./app. Beware, that won't work for root user and suid applications.

  1. You can actually try to create chrooted environment for the application. Keep in mind, that chroot call resets the location of the root(/) directory for application that runs under it. In practice, that means that you need to provide not only the replacement glibc library, but ALL the libraries that used by your application and libraries that used by those libraries and so on, until you have everything that would create self-sufficient environment. That also implies presence of at least /dev/null, /dev/stdin, /dev/stdout and /dev/log devices, as well as /etc/passwd and /etc/group files. The good example of such environment on Debian is postfix installation(check /var/spool/postfix/). The launch command itself would be simple:

    chroot /home/of/chrooted/app ./app
    
  2. The best and easiest way though would be usage of the docker and appropriate image, that suitable for your app. Installing docker is whole huge topic by itself, you can start with Docker installation guide. One pre-requirement for it though Linux kernel greater than 3.8+. Besides this limitation it's the best way to run an app that requires different distribution/libraries set.

Also, check how to run new software without updating GLIBC?

1
  • Great! I tried the first option and works like a charm. Thanks. May 12, 2015 at 22:58
3

A chrooted environment where you install a distribution with the target vintage is the least-effort solution. It'll cost you maybe a couple of GB of disk space, but it's pretty painless, especially on Debian and derivatives where schroot does the job of setting up a usable chroot environment and Debootstrap can install an older or newer release of Debian or Ubuntu in that chroot environment. See How do I run 32-bit programs on a 64-bit Debian/Ubuntu? for a schroot+debootstrap guide. For GLIBC 2.14, you can pick jessie (Debian) or precise or trusty (Ubuntu) as the release to install with debootstrap.

With the default schroot setup, you run something like

schroot -c jessie ./app

Your home directory is automatically available at the same path in the chroot. As long as the application is installed under your home directory and only needs to access other files under your home directory or software that exists inside the chroot, you're all set.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .