Solved Error when trying to run linux software

I needed to run some linux software - I installed the emulator base-c7 as mentioned https://docs.freebsd.org/en/books/handbook/linuxemu/

However when I try to run the script it gives the following error :
./program_name: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by ../program_name

Upon reading another post this kind of ourput was asked - so here it is from the machine i'm testing it on

Code:
strings /compat/linux/lib64/libstdc++.so.6 | grep GLIBCXX
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_3.4.19
GLIBCXX_DEBUG_MESSAGE_LENGTH

Is it possible to fix this?
 
You need a slightly newer Linux.

Try following instructions that tell you how to use Ubuntu instead of c7 in FreeBSD.
Do you mean to say running Ubuntu on Freebsd is the preferred way to go these days?

If that's the case I would probably consider deleting the c7 package
 
Do you mean to say running Ubuntu on Freebsd is the preferred way to go these days?
I wouldn't say "preferred". It depends on what you want to do. The Centos-7 userland is the default and advantages are that it's packaged (so, managed by pkg) and ports of linux-software just work with it.

For Linux software that's NOT available as a port (the vast majority) and needs newer Linux libraries, installing your own Linux userland (for example Ubuntu) is the simplest solution. There you have the choice whether you want to install a separate Linux jail or even use your userland for the compat overlay (by default at /compat/linux).

Depending on what you want to run, there could be ways to make it work with the c7 userland as well. If it's opensource, you could try to rebuild it. Even if not, the GNU libstdc++ comes with GCC and can often be built even with an older glibc, then you could use it as a private library (e.g. by using LD_PRELOAD or patching the rpath of your Linux binary with sysutils/patchelf). But most likely, this is a lot more work than just installing e.g. an Ubuntu userland.
 
If that's the case I would probably consider deleting the c7 package

Whilst c7 is useful to run older and enterprise software; I sometimes just wonder if dnf/yum/debootstrap in ports should become the main focus (i.e of the handbook) to do a proper bootstrap of a Linux userland instead of these packages. For one they seem to be missing some random files making it even more difficult to navigate the lack of a proper "base" Linux install.
 
Whilst c7 is useful to run older and enterprise software; I sometimes just wonder if dnf/yum/debootstrap in ports should become the main focus (i.e of the handbook) to do a proper bootstrap of a Linux userland instead of these packages. For one they seem to be missing some random files making it even more difficult to navigate the lack of a proper "base" Linux install.

I kinda second the notion. A debootstrap based /compat/linux is attractive. And the ability to run a Linux based browser should be part of the ports/packages system IMHO. For me that is more important than those packages that are just released for REL. I'm not into software archeology. And/or a REL compatible environment could be updated from CentOS (which is dead) to e.g. Rocky Linux (same people as CentOS, but updated software).
 
Back
Top