Hello 
20200502 - Working with FreeBSD 12.1 amd64
EDIT 20200506: Solved with solution described in this first post, short how-to on third post.
I'm trying to install MySQL-Workbench Linux application (Red Hat 7 app version).
In the past this app was in the FreeBSD ports tree. Maybe I should try to build this app directly from the sources (still available on Oracle's website).
But let say this thread is more generalistic; Speaking about installation of Linux apps and issues.
Setup
First step: the FreeBSD Hanbook related chapter, and do checks
Running app Issue: Command not found
Running app Issue:
Don't forget to be up-to-date with the
Solution 1 - Linux library provided by FreeBSD:
Solution 2 - Linux library provided by the app itself:
Solution 3 - Linux Labrary as an RPM:
Solution 4 - FreeBSD Library: (not sure this works)
EDIT 20200506 : See post 3, after a 'reset' I was able to get all need libraries with solution 1/2/3 - all together - solution 4 not necessary
Running app Issue: ELF file OS ABI invalid with FreeBSD library
Running app Issue: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found
Solved for MySQL-Workbench last version - See post 3.

20200502 - Working with FreeBSD 12.1 amd64
EDIT 20200506: Solved with solution described in this first post, short how-to on third post.
I'm trying to install MySQL-Workbench Linux application (Red Hat 7 app version).
In the past this app was in the FreeBSD ports tree. Maybe I should try to build this app directly from the sources (still available on Oracle's website).
But let say this thread is more generalistic; Speaking about installation of Linux apps and issues.
Setup
First step: the FreeBSD Hanbook related chapter, and do checks
- Kernel:
Code:
# kldstat | grep linux linux_common.ko linux.ko linux64.ko
- Linux pkg:
Code:
# pkg info | grep linux linux_base-c7-7.7.1908_1
- rpm installation pkg:
Code:
# pkg info | grep rpm rpm4-4.15.1_1
- Install:
Code:
# cd /compat/linux # rpm2cpio /path/mysql-workbench-community-8.0.19-1.el8.x86_64.rpm | cpio -id 397624 blocks
Running app Issue: Command not found
- as standard user
Code:
# /compat/linux/bin/mysql-workbench ./mysql-workbench: Command not found. # ls -l /compat/linux/bin/mysql-workbench -rwxr-xr-x /compat/linux/bin/mysql-workbench
- as root
Code:
# ldd /usr/compat/bin/mysql-workbench ldd: mysql-workbench-bin: No such file or directory
- probably because it is a Shell script (thanks to vermaden with this thread Fix Broken Dependency on FreeBSD)
- So as vermaden explains check the script and get the real app binary file. (extract)
Code:
# cat /compat/linux/bin/mysql-workbench #!/bin/bash [...] export [...] export MWB_BINARIES_DIR="$destdir/usr/libexec/mysql-workbench" [...] $MWB_BINARIES_DIR/mysql-workbench-bin "$@"
- We can understand that the binary is: /compat/linux/usr/libexec/mysql-workbench/mysql-workbench-bin
- let's do a ldd now (extract)
Code:# ldd /compat/linux/usr/libexec/mysql-workbench/mysql-workbench-bin linux_vdso.so.1 => (0x00007ffffffff000) libsqlide.so.8.0.19 => not found libwbprivate.so.8.0.19 => not found libxml2.so.2 => not found [...] libmount.so.1 => /lib64/libmount.so.1 (0x0000000805200000) libblkid.so.1 => /lib64/libblkid.so.1 (0x0000000805600000)
- a lot of libraries not found
Running app Issue:
ldd
reports library not foundDon't forget to be up-to-date with the
pkg update
Solution 1 - Linux library provided by FreeBSD:
- example with "libgtk-3.so.0 => not found"
- check if there is a pkg that provides the Linux library
-
Code:
# pkg search linux | grep gtk linux-c7-gtk3-3.22.30 GTK+ library, version 3.X (Linux CentOS 7.7.1908)
- if yes, then install it
pkg install linux-c7-gtk3
and don't forget to check messages after installation -
Code:
# pkg install linux-c7-gtk3 [...] [36/36] Installing linux-c7-gtk3-3.22.30... [36/36] Extracting linux-c7-gtk3-3.22.30: 100% ===== Message from linux-c7-dri-18.3.4_1: This package needs linsysfs mounted on /compat/linux/sys. Add the following line to /etc/fstab: linsysfs /compat/linux/sys linsysfs rw 0 0
- During the pkg installation process you see that the x11-toolkits/linux-c7-gtk3 pkg will install a lot of others Linux librairies, so after installation redo a
ldd
to see the updated output - More generally if your Linux app is "complex modern" app you will probably add the emulators/linux-c7 pkg
Solution 2 - Linux library provided by the app itself:
- For some libraries it is possible that FreeBSD may not provide them. In my example MySQL-Workbench app have his associated librairies folder
- extract
Code:
# ls -l /compat/linux/lib64/mysql-workbench/lib* lrwxrwxrwx /compat/linux/lib64/mysql-workbench/libantlr4-runtime.so -> libantlr4-runtime.so.4.7.1 -rw-r--r-- /compat/linux/lib64/mysql-workbench/libantlr4-runtime.so.4.7.1 [...] lrwxrwxrwx /compat/linux/lib64/mysql-workbench/libwbssh.so -> libwbssh.so.8.0.19 -rw-r--r-- /compat/linux/lib64/mysql-workbench/libwbssh.so.8.0.19
- So I decide to link those libraries, sample here:
-
Code:
# cd /compat/linux/usr/lib64 # ln -s mysql-workbench/libwbprivate.so.8.0.19 .
Solution 3 - Linux Labrary as an RPM:
- For some libraries it will be necessary to install them with the CentOS rpm package
- Get the rpm from CentOS 7 packages, you can also have a look in the CentOS 7 update packages.
- Then install (in my case I did that for libgtkmm, libatkmm, libgdkmm, ...)
Solution 4 - FreeBSD Library: (not sure this works)
EDIT 20200506 : See post 3, after a 'reset' I was able to get all need libraries with solution 1/2/3 - all together - solution 4 not necessary
- example with "libsecret-1.so.0 => not found"
- let see if the library is there somewhere
Code:# ls -l /compat/linux/lib/libsecret-1.so.0* ls: not found
-
Code:
# ls -l /compat/linux/lib64/libsecret-1.so.0* ls: not found
-
Code:
# ls -l /usr/local/lib/libsecret-1.so.0* lrwxr-xr-x /usr/local/lib/libsecret-1.so.0 -> libsecret-1.so.0.0.0 -rwxr-xr-x /usr/local/lib/libsecret-1.so.0.0.0
- If you don't find the library you probably need to install it (see also notes below). In my example "libzip" was not install, so I did a
pkg install libzip
- Then, again the Handbook: "copy all the files in the last column of the output from the Linux® system into /compat/linux".
- let's do for libsecret-1.so.0 and check with ldd again as a complete example
- before
Code:
# # ldd /compat/linux/usr/libexec/mysql-workbench/mysql-workbench-bin | grep secret libsecret-1.so.0 => not found
- update
Code:
# cd /compat/linux/lib64 # cp /usr/local/lib/libsecret-1.so.0 .
- after
Code:
# ldd /compat/linux/usr/libexec/mysql-workbench/mysql-workbench-bin | grep secret (no result here - means now library found)
- linking done
Running app Issue: ELF file OS ABI invalid with FreeBSD library
- after linking all the missing libraries, you get a new issue
-
Code:
# ldd /compat/linux/usr/libexec/mysql-workbench/mysql-workbench-bin /compat/linux/usr/libexec/mysql-workbench/mysql-workbench-bin: error while loading shared libraries: /lib64/libsecret-1.so.0: ELF file OS ABI invalid
- Again the Handbook, "help the FreeBSD kernel distinguish between a FreeBSD ELF binary and a Linux® binary"
-
Code:
# brandelf -t linux /compat/linux/lib64/libsecret-1.so.0
Running app Issue: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found
- Run
-
Code:
# ./mysql-workbench-bin ./mysql-workbench-bin: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by ./mysql-workbench-bin) ./mysql-workbench-bin: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by ./mysql-workbench-bin) ./mysql-workbench-bin: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by ./mysql-workbench-bin) [...] ./mysql-workbench-bin: /lib64/libssl.so.1.1: version `OPENSSL_1_1_1' not found (required by /lib64/libmysqlclient.so.21) ./mysql-workbench-bin: /lib64/libssl.so.1.1: version `OPENSSL_1_1_0' not found (required by /lib64/libmysqlclient.so.21) ./mysql-workbench-bin: /lib64/libcrypto.so.1.1: version `OPENSSL_1_1_1' not found (required by /lib64/libmysqlclient.so.21) ./mysql-workbench-bin: /lib64/libcrypto.so.1.1: version `OPENSSL_1_1_0' not found (required by /lib64/libmysqlclient.so.21) ./mysql-workbench-bin: /lib64/libpng15.so.15: version `PNG16_0' not found (required by /lib64/libgdal.so.1) ./mysql-workbench-bin: /lib64/libc.so.6: version `GLIBC_2.28' not found (required by /lib64/libsqlite3.so)
- We can check that for listed libraries if they contain the required version
- check (example)
Code:# strings libstdc++.so.6 | grep GLIBCXX GLIBCXX_3.4 GLIBCXX_3.4.1 GLIBCXX_3.4.2 [...] GLIBCXX_3.4.14 GLIBCXX_3.4.15 GLIBCXX_3.4.16 GLIBCXX_3.4.17 GLIBCXX_3.4.18 GLIBCXX_3.4.19
- So we can see the wanted version is not present. Then I try to update the library version to the last provided on CentOS 7 archived rpm but the same.
- My only solution here is to go with an older version of the Linux app.
Solved for MySQL-Workbench last version - See post 3.
Last edited: