Score:0

Install old libg2c i386 and amd64 on 22.04 LTS

im flag

I have been fighting for a while now with some old softwares which requires libg2c.so.0. One software requires the i386 version while the other requires the amd64 version.

I added the old-releases to my apt configuration:

sudo nano /etc/apt/sources.list.d/old-releases.list

deb     [trusted=yes]    http://old-releases.ubuntu.com/ubuntu hardy universe
deb-src [trusted=yes]    http://old-releases.ubuntu.com/ubuntu hardy universe

And I can now install one or the other:

sudo apt update
sudo apt install gcc-3.4-base libg2c0
# OR
sudo apt install gcc-3.4-base:i386 libg2c0:i386

But no way to install both at the same time. One removes the other.

So.. what option do I have to install both since if I have 3 softwares, one that works with the i386 version installed and 2 that work with the amd64 version.

Note that this is not my software, and that recompiling it is not an option.

Artur Meinild avatar
vn flag
When you have a dilemma like this that involves ancient software, the good answer is usually virtualization. Spin up a 32-bit VM for whatever purpose, and run your legacy software from that. Spin up another 64-bit VM if you need to run 64-bit legacy software. I would highly advise against installing legacy packages on anything that is **not** a VM.
hr flag
... or you could consider just manually installing the required **libraries** to somewhere local (like `~/lib64` / `~/lib32`, or `/opt/name-of-old-software/lib{64,32}` for multiple users) and then using wrapper scripts to set appropriate `LD_LIBRARY_PATH`s for them
Mathieu avatar
im flag
@steeldriver That second option seems very interesting, but I'm lacking a bit in knowledge. Could you post an answer based on it, with a bit of detail? Especially about this wrapper.
hr flag
@Mathieu can you first confirm if either (or both) pieces of software actually run if you manage to install one of the package(s)? If not, the hardy-era libraries may simply be incompatible with current libc6 / libm etc. and the approach is doomed.
Mathieu avatar
im flag
@steeldriver Oh they do work, I'm amazed by old softwares like those that still run on modern OS. But 2 of them run if the 64 bits version is installed while one run if the 32 bits version is.
Mathieu avatar
im flag
@steeldriver FYI, your solution with LD_LIBRARY_PATH worked great!
Score:1
im flag

To obtain the libraries gcc-3.4-base and libg2c, I added the following sources to apt:

deb     [trusted=yes]    http://old-releases.ubuntu.com/ubuntu hardy universe
deb-src [trusted=yes]    http://old-releases.ubuntu.com/ubuntu hardy universe

I then downloaded the libraries and dependency tree with

sudo apt install --download-only gcc-3.4-base libg2c

And then 'unpackaged them' in a directory e.g. /usr/local/mylib_i386 with:

ls -1 | grep [.]deb >> all_debs.txt
cat all_debs.txt | while read fn; do dpkg-deb -x $fn /usr/local/mylib_i386; done

I had 2 different folders for the i386 and amd64 old-libs that I needed. Then, the program running with the i386 lib is wrapped with a .sh file:

export LD_LIBRARY_PATH=/usr/local/mylib_i386/usr/...:$LD_LIBRARY_PATH
path/to/program

With the ... in the path to the lib directory and sub-directories (LD_LIBRARY_PATH does not look into subdirectories).

There are probably other ways to do it.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.