Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Is it possible to install and use two different glibc versions on the same machine. Where one version is only used to run legacy software, which relies on old glibc binaries?

Is it possible to do that with the aid of the package manager (something like "install this package, and its dependencies, to /opt/old-glibc), instead of managing it dire

share|improve this question
3  
Must be, but... oh, so much pain. –  Tshepang May 3 '11 at 12:34
    
Possibly, but you'll need to give more details. What OS (version of Debian/Ubuntu) precisely, and more imporantly what is the legacy software, and what libc version does it use? I think ldd would tell you something. If possible you may need to recompile the legacy libc library and/or install/recompile supporting packages. Depending on how old your app is, this could get tricky. I see current Debian libc6 depends on libc-bin (= 2.13-0exp5) and libgcc1, so libc6 doesn't have a lot of dependencies, but you could still run into problems. –  Faheem Mitha May 3 '11 at 13:15

1 Answer 1

up vote 6 down vote accepted

Yes, it's possible. You'll have to be very careful with the library load paths, and you may need to recompile some other libraries.

As the path of least friction, I recommend installing an older version of Debian or Ubuntu in a chroot. That is, make a directory, say /old/etch, and install the older distribution in the tree rooted there; to run that problematic program, call chroot to restrict its view of the filesystem to /old/etch.

Debian (or Ubuntu) comes with a package to assist with installing another system in a chroot: schroot (successor of dchroot). First, use debootstrap to install the older distribution (install only the base system and what your program needs, no servers). Then set up schroot to run the program conveniently (with /dev, /proc, /home and other “satellite” filesystems accessible).

So the plan is: debootstrap, then dchroot. In How do I run 32-bit programs on a 64-bit Ubuntu?, I give a tutorial about a similar setup − whether you're running different versions of the distribution, or different architectures, or different Debian-like distributions, it's only a matter of selecting the appropriate package source, the rest is the same.

share|improve this answer
    
If one already has the newer version installed, can he start from that and then, on top of the newer, install the older one into /old/etch? –  naxa Nov 7 '12 at 14:06
    
@naxa Yes, in fact that's the situation described here, but it works in the same way if you go the other way round (newer chrooted in the older). I did in fact write a debootstrap/schroot tutorial a few days after writing this answer, I've added the link. –  Gilles Nov 7 '12 at 19:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.