Page 1 of 2

STICKY: libmysqlclient18 has no installation candidate

Posted: Tue Aug 22, 2017 2:43 am
by emcdowell
I am trying to follow the guide for setting up a LAMP server however I cannot install php5-mysql.

I get the error that it cannot install libmysql client18 and when I try to install that I get the error "E: Package 'libmysqlclient18' has no installation candidate"

I have tried sudo apt-get update, sudo apt-get upgrade, and sudo apt-get dist-upgrade and none of them have made any difference.

I have tried a fresh install, as well as restarting and it still won't work.

I have successfully installed apache2, php5, and mysql-server, along with the other packages mentioned in the getting started guide.

I am working off a raspberry pi 2 model B if that makes a difference.

How do I get php5-mysql to work? Thank you.

Re: libmysqlclient18 has no installation candidate

Posted: Tue Aug 22, 2017 9:52 am
by rost
I have the same problem. What's interesting is that I installed LAMP on virtual machine without problems. When I try to do it from my new RPi3, this problem occurs. I bought it for our small company to be our local web server but I am running in circles for two days already with zero success.

Re: libmysqlclient18 has no installation candidate

Posted: Tue Aug 22, 2017 9:52 am
by DougieLawson
Try installing these pieces

libmariadbclient18 mariadb-client-10.1 mariadb-client-core-10.1 mariadb-common mariadb-server-10.1 mariadb-server-core-10.1

Re: libmysqlclient18 has no installation candidate

Posted: Tue Aug 22, 2017 2:58 pm
by wnodvik
Hi, new person, same problem.

I tried installing the mariadb packages as suggested, however I still cannot install libmysqlclient18. E: Package 'libmysqlclient18' has no installation candidate

Is there any sort of insight to that error you could provide?

Re: libmysqlclient18 has no installation candidate

Posted: Wed Aug 23, 2017 1:35 am
by DougieLawson
It'll be next week before I have a 2017-08-16 Stretch system running, typically, they released it while I'm 4000 miles away from any of my Raspberries.

Re: libmysqlclient18 has no installation candidate

Posted: Thu Aug 24, 2017 9:48 am
by ttbinda
Hi
I confirm the bug. Installing mariadb* packages is useless: they are already installed.
There are not any libmysqlclient* (18 is the reuqest) candidate.
I'll try to install it manually, however.
I'm running a fresh 2017-08-16-raspbian-stretch-lite distro. Update is useless.
Thank you

Re: libmysqlclient18 has no installation candidate

Posted: Thu Aug 24, 2017 9:54 am
by ttbinda
Solved!
Download from here https://packages.debian.org/wheezy/armh ... 8/download the package
then install it via
sudo dpkg --install libmysqlclient18
and then reinstall php5-mysql via apt-get
apt-get install php5-mysql
now misqli is installed
cheers

Re: libmysqlclient18 has no installation candidate

Posted: Sun Aug 27, 2017 5:39 am
by rbain13
Just created an account to say that the post above by ttbinda fixed my problems!

Cheers indeed ^_^

Re: libmysqlclient18 has no installation candidate

Posted: Tue Aug 29, 2017 8:37 pm
by RonR
ttbinda wrote:
Thu Aug 24, 2017 9:54 am
Download from here https://packages.debian.org/wheezy/armh ... 8/download the package
Is there some reason you chose the Wheezy version of libmysqlclient18 instead of the Jessie version for use with Stretch?

Re: libmysqlclient18 has no installation candidate

Posted: Thu Aug 31, 2017 4:19 pm
by bmelum
ttbinda wrote:
Thu Aug 24, 2017 9:54 am
Solved!
Download from here https://packages.debian.org/wheezy/armh ... 8/download the package
then install it via
sudo dpkg --install libmysqlclient18
and then reinstall php5-mysql via apt-get
apt-get install php5-mysql
now misqli is installed
cheers
This solves my problem!
I have a real beginner question. How do I download the package you have linked? I tried using apt-get but could not figure out what to write after that. I have searched the web but could not find a similar application, even though that is just me not understanding stuff right now.

Cheers!

Re: libmysqlclient18 has no installation candidate

Posted: Thu Aug 31, 2017 5:13 pm
by DougieLawson
Download from http://archive.raspbian.org/raspbian/po ... _armhf.deb
to get the latest Jessie version while we're waiting for the Raspbian folks to fix this error.

Get http://archive.raspbian.org/raspbian/po ... _armhf.deb if you're running MariaDB 10.1 rather than MySQL 5.5

Re: libmysqlclient18 has no installation candidate

Posted: Fri Sep 15, 2017 12:16 pm
by Sockbat
ttbinda wrote:
Thu Aug 24, 2017 9:54 am
Download from here https://packages.debian.org/wheezy/armh ... 8/download the package
Thanks for that!

Re: libmysqlclient18 has no installation candidate

Posted: Fri Sep 22, 2017 4:03 pm
by sleepdeficit
This worked for me:

Code: Select all

sudo apt-get install mysql-common
------------------------------

The last line is spit out was:
Setting up libmysqlclient18:armhf (5.5.57-0+deb7u1) ...
------------------------------

After that, I was--for my purposes--successfully able to:

Code: Select all

sudo apt-get install mysql-server php5-mysql -y
------------------------------

Hope that helps!
- sleepdeficit

Re: libmysqlclient18 has no installation candidate

Posted: Tue Oct 17, 2017 7:18 pm
by zweefvlieg
Thank you Dougie, now it works! :D

Re: STICKY: libmysqlclient18 has no installation candidate

Posted: Wed Oct 18, 2017 9:57 am
by mahjongg
I asked around, and this is what ShiftPlusOne replied:
ShiftPlusOne wrote:
Tue Oct 17, 2017 11:06 pm
It's nothing to do with Raspbian directly. Debian don't have the package for stretch, so unless something is pulling it in as a dependency, this isn't a problem. The functionality is provided by mariadb instead of mysql. I think people who are trying to install it are following out of date tutorials or using external repos.
https://bugs.debian.org/cgi-bin/bugrepo ... bug=837615

Raspbian has a 'mediatomb' package which depends on mysql, but that's not in Debian. It seems to have been brought forward from Jessie for some reason.

Re: STICKY: libmysqlclient18 has no installation candidate

Posted: Wed Oct 18, 2017 11:32 am
by DougieLawson
mahjongg wrote:
Wed Oct 18, 2017 9:57 am
I asked around, and this is what ShiftPlusOne replied:
ShiftPlusOne wrote:
Tue Oct 17, 2017 11:06 pm
It's nothing to do with Raspbian directly. Debian don't have the package for stretch, so unless something is pulling it in as a dependency, this isn't a problem. The functionality is provided by mariadb instead of mysql. I think people who are trying to install it are following out of date tutorials or using external repos.
https://bugs.debian.org/cgi-bin/bugrepo ... bug=837615

Raspbian has a 'mediatomb' package which depends on mysql, but that's not in Debian. It seems to have been brought forward from Jessie for some reason.
That's wrong.

Get a fresh SDCard, install Raspbian Stretch on it. Then follow the official Raspberry Pi Foundation docs at: https://projects.raspberrypi.org/en/pro ... -wordpress

That LAMP server won't install without using my recipe viewtopic.php?f=28&t=191380#p1205095

Re: STICKY: libmysqlclient18 has no installation candidate

Posted: Wed Oct 18, 2017 12:26 pm
by ShiftPlusOne
Which part of my reply is wrong?

That seems like a problem with the learning resource rather than with Raspbian. Again, this is a change that was made in debian, and not by us. The instructions should be updated for mariadb. I believe there is a metapackage which installs the appropriate default package.

Re: STICKY: libmysqlclient18 has no installation candidate

Posted: Wed Oct 18, 2017 4:54 pm
by DougieLawson
ShiftPlusOne wrote:
Tue Oct 17, 2017 11:06 pm
... I think people who are trying to install it are following out of date tutorials or using external repos.
ShiftPlusOne wrote:
Wed Oct 18, 2017 12:26 pm
Which part of my reply is wrong?
It's the "out of date tutorials". Because you can still choose to use MySQL on Stretch. If we swap mysql packages with mariadb packages in those tutorials we'll end up with the equivalent problem.
And
It's the "external repos". Because I can get it to fail on a fresh copy of plain Raspbian Stretch 2017-09-07 using stock standard unmodified /etc/apt files.

It's just plain broken for both MySQL and MariaDB (which I've been running for years because AriaDB is better than InnoDB).

My ugly fix is to pull the latest debs from Jessie, install one of those (for either MariaDB or MySQL) then run away happy. So you must be able do that with Stretch, just make those Jessie debs available as Stretch installation candidates (however that gets done). Then moan at the upstream maintainers because they've broken it.

Re: STICKY: libmysqlclient18 has no installation candidate

Posted: Wed Oct 18, 2017 6:27 pm
by ShiftPlusOne
Thanks, I'm somewhat sceptical, but I'll take a closer look in the morning.

Re: STICKY: libmysqlclient18 has no installation candidate

Posted: Thu Oct 19, 2017 6:40 am
by ShiftPlusOne
Looks like the problem is here:

Code: Select all

sudo apt-get install mysql-server php5-mysql -y
It should be:

Code: Select all

sudo apt-get install default-mysql-server php7.0-mysql -y
php5 should not have been included in stretch.

There might be other problems. Will let you know once wordpress is set up.

Re: STICKY: libmysqlclient18 has no installation candidate

Posted: Thu Oct 19, 2017 6:57 am
by ShiftPlusOne
LAMP stack up and running without libmysqlclient18.

The only other change to that resource should be that in order to log in as root, you have to run mysql as root. I added a new user for wordpress and it all just worked.

Re: STICKY: libmysqlclient18 has no installation candidate

Posted: Thu Oct 19, 2017 7:49 am
by DougieLawson
So is it possible to disable php5 with some sort of funky apt/deb/whatever package that means when someone tries to install php5-mysql they get php7.0-mysql instead?

Re: STICKY: libmysqlclient18 has no installation candidate

Posted: Thu Oct 19, 2017 8:17 am
by ShiftPlusOne
Yes, but since it's possible that somebody actually wants to run php5 instead with your workaround, that would mess things up for them. I think it's best to find out why uninstallable packages which aren't in Debian are being included in Raspbian.

As far as the learning resource itself goes, there seems to already be an issue open about this.
https://github.com/raspberrypilearning/ ... -337817504

Re: STICKY: libmysqlclient18 has no installation candidate

Posted: Thu Oct 19, 2017 9:14 am
by DougieLawson
Thank you. I think we've now got a "sticky" thread that explains how to make php5 work and how to do it properly with php7.

Re: STICKY: libmysqlclient18 has no installation candidate

Posted: Fri Oct 20, 2017 10:33 am
by NickT
DougieLawson wrote:
Thu Oct 19, 2017 9:14 am
Thank you. I think we've now got a "sticky" thread that explains how to make php5 work and how to do it properly with php7.
I couldn't find the 'sticky' thread, if you know where it is I'd be most grateful for a link. A while ago whilst porting my existing project which used php5 from Jessie to Stretch, I did manage this by installing php7 and there were a few functions missing from my php pages, which I managed to fix by installing some other stuff. I'm ashamed to say that I've completely forgotten what I did, so anything that would be useful for making the notes that I should have made in the first place would be great.