So I’m running a program a college wrote on debian. When I do, the following error arises:
error while loading shared libraries: libmysqlclient.so.20: cannot open shared object file: No such file or directory
I tried installing the following packages because of different search results I did:
apt-get install libmariadbclient-dev-compat
apt-get install default-libmysqlclient-dev
apt-get install mysql-common
Searches like:
find . -name 'libmysqlclient*'
locate libmysqlclient.so
Get’s nothing as output.
I found a supposed fix using yum but as I am using debian it’s not a solution for me.
I found the .20 is something about Oracle MySQL 5.7
(https://community.centminmod.com/threads/libmysqlclient-so-missing.9052/)
Does anybody know how to fix the problem? Thanks in advance.
asked Sep 27, 2018 at 10:07
1
Apparently the program was compiled against a version of MySQL downloaded from www.mysql.com; libmysqlclient.so.20 was not available in Debian.
You can download a .deb from https://dev.mysql.com/downloads/file/?id=477124 that configures your Debian(-based) system to access the www.mysql.com apt repository. You can then update the apt data:
# apt-get update
and install the correct library:
# apt-get install libmysqlclient20
Note that this will probably want to remove your Debian version of MySQL, if installed! So consider carefully what you want.
An alternative is to browse the apt repository, and download just the libmysqlclient20 .deb manually. Unpack this, e.g.:
# dpkg-deb --extract libmysqlclient20_5.7.23-1debian9_amd64.deb /tmp/libmysqlclient20
You could then copy the libmysqlclient.so.20 to somewhere that’s searched for shared libraries, e.g. /usr/local/lib/ and it should work.
answered Sep 27, 2018 at 12:17
1
In case someone else is running into this problem on Ubuntu 20.04, you can just add the older repos which will contain libmysqlclient20
to your APT sources (similar to Jylia Silver’s answer.
sudo tee /etc/apt/sources.list.d/xenial.list > /dev/null <<EOF
deb http://dk.archive.ubuntu.com/ubuntu/ xenial main
deb http://dk.archive.ubuntu.com/ubuntu/ xenial universe
deb http://dk.archive.ubuntu.com/ubuntu/ xenial-updates universe
EOF
sudo apt-get update
sudo apt-get install -y libmysqlclient20
answered Dec 10, 2020 at 15:48
3
echo "deb http://ftp.us.debian.org/debian unstable main contrib non-free" >> /etc/apt/sources.list.d/unstable.list
apt-get update
apt-get install libmysqlclient20
answered Sep 21, 2020 at 19:21
Alternatively to the correct solution from wurtel, an unsafe, dirty, not suitable for production, hacky method is to simply create a symbolic link from a close enough version to the file the program is looking for:
ln -s /usr/lib/libmysqulclient.so.23 /usr/local/lib/libmysqlclient.so.20
It may work or not. Most of the time, if the source file is only slightly newer, it should be fine. Of course I reiterate that this is unsafe and just for tests.
answered Sep 27, 2018 at 13:07
wazooxwazoox
1,29610 silver badges16 bronze badges
When I’m Trying to Run the Following command on Ubuntu 20 :
apt-get update
apt install mysql-server libmysqlclient20
I get the following error :
E: Package 'libmysqlclient20' has no installation candidate
the process is part of running some application and when i try to run the application (regardless to the error) it says :
libmysqlclient.so.20: cannot open shared object file: No such file or directory
Any Help ?!
Regards
asked Aug 6, 2020 at 6:33
Colin JackColin Jack
1331 silver badge6 bronze badges
2
Ubuntu 20 replaced libmysqlclient20
with libmysqlclient21
, but you can still get the old version by adding an earlier Ubuntu version’s repository to your apt sources, then using apt install
:
echo 'deb http://security.ubuntu.com/ubuntu xenial-security main' | sudo tee /etc/apt/sources.list.d/xenial-security.list
sudo apt update
sudo apt install libmysqlclient20
answered May 13, 2021 at 1:21
JellicleCatJellicleCat
7755 silver badges18 bronze badges
You have to install its development version (with headers) by
sudo apt-get install libmysqlclient-dev
and it will pull correct dependency.
answered Aug 6, 2020 at 6:38
N0rbertN0rbert
94.4k30 gold badges223 silver badges407 bronze badges
1
The solution from JellicleCat fixed it for me. Specially if you are coming from trying to get your RAILS application to work and deploy again.
echo 'deb http://security.ubuntu.com/ubuntu xenial-security main' | sudo tee /etc/apt/sources.list.d/xenial-security.list
sudo apt update
sudo apt install libmysqlclient20
answered Oct 11, 2021 at 15:52
Solved by getting the file «libmysqlclient20» manually and then place it in «/usr/lib/x86_64-linux-gnu/»
Regards
answered Aug 8, 2020 at 16:44
Colin JackColin Jack
1331 silver badge6 bronze badges
Unix & Linux Asked by Agustin Barrachina on January 28, 2021
So I’m running a program a college wrote on debian. When I do, the following error arises:
error while loading shared libraries: libmysqlclient.so.20: cannot open shared object file: No such file or directory
I tried installing the following packages because of different search results I did:
apt-get install libmariadbclient-dev-compat
apt-get install default-libmysqlclient-dev
apt-get install mysql-common
Searches like:
find . -name 'libmysqlclient*'
locate libmysqlclient.so
Get’s nothing as output.
I found a supposed fix using yum but as I am using debian it’s not a solution for me.
I found the .20 is something about Oracle MySQL 5.7
(https://community.centminmod.com/threads/libmysqlclient-so-missing.9052/)
Does anybody know how to fix the problem? Thanks in advance.
4 Answers
Apparently the program was compiled against a version of MySQL downloaded from www.mysql.com; libmysqlclient.so.20 was not available in Debian.
You can download a .deb from https://dev.mysql.com/downloads/file/?id=477124 that configures your Debian(-based) system to access the www.mysql.com apt repository. You can then update the apt data:
# apt-get update
and install the correct library:
# apt-get install libmysqlclient20
Note that this will probably want to remove your Debian version of MySQL, if installed! So consider carefully what you want.
An alternative is to browse the apt repository, and download just the libmysqlclient20 .deb manually. Unpack this, e.g.:
# dpkg-deb --extract libmysqlclient20_5.7.23-1debian9_amd64.deb /tmp/libmysqlclient20
You could then copy the libmysqlclient.so.20 to somewhere that’s searched for shared libraries, e.g. /usr/local/lib/ and it should work.
Correct answer by wurtel on January 28, 2021
In case someone else is running into this problem on Ubuntu 20.04, you can just add the older repos which will contain libmysqlclient20
to your APT sources (similar to Jylia Silver’s answer.
sudo tee /etc/apt/sources.list.d/xenial.list > /dev/null <<EOF
deb http://dk.archive.ubuntu.com/ubuntu/ xenial main
deb http://dk.archive.ubuntu.com/ubuntu/ xenial universe
deb http://dk.archive.ubuntu.com/ubuntu/ xenial-updates universe
EOF
sudo apt-get update
sudo apt-get install -y libmysqlclient20
Answered by Karl Wilbur on January 28, 2021
echo "deb http://ftp.us.debian.org/debian unstable main contrib non-free" >> /etc/apt/sources.list.d/unstable.list
apt-get update
apt-get install libmysqlclient20
Answered by Jylia Silver on January 28, 2021
Alternatively to the correct solution from wurtel, an unsafe, dirty, not suitable for production, hacky method is to simply create a symbolic link from a close enough version to the file the program is looking for:
ln -s /usr/lib/libmysqulclient.so.23 /usr/local/lib/libmysqlclient.so.20
It may work or not. Most of the time, if the source file is only slightly newer, it should be fine. Of course I reiterate that this is unsafe and just for tests.
Answered by wazoox on January 28, 2021