3

After downloading MYSQL APT Repository at

http://cdn.mysql.com//Downloads/MySQL-5.7/libmysqld-dev_5.7.11-1debian8_amd64.deb

I ran the command

dpkg -i libmysqld-dev_5.7.11-1debian8_amd64.deb

and here is the result

Selecting previously unselected package mysql-community-server.
(Reading database ... 48773 files and directories currently installed.)
Preparing to unpack mysql-community-server_5.7.11-1debian8_amd64.deb ...
Unpacking mysql-community-server (5.7.11-1debian8) ...
dpkg: dependency problems prevent configuration of mysql-community-server:
 mysql-community-server depends on mysql-common (= 5.7.11-1debian8); however:
  Package mysql-common is not installed.
 mysql-community-server depends on mysql-client (= 5.7.11-1debian8); however:
  Package mysql-client is not installed.

dpkg: error processing package mysql-community-server (--install):
 dependency problems - leaving unconfigured
Processing triggers for systemd (215-17+deb8u3) ...
Processing triggers for man-db (2.7.0.2-5) ...
Errors were encountered while processing:
 mysql-community-server

Did I do anything wrong? How can I fix it?

6

You can see the Depends list inside the DEBIAN/control file of the binary package libmysqld-dev_5.7.11-1debian8_amd64.deb, then download and install the ones your system doesn't have.

Example

> wget http://cdn.mysql.com//Downloads/MySQL-5.7/libmysqld-dev_5.7.11-1debian8_amd64.deb
> ar x libmysqld-dev_5.7.11-1debian8_amd64.deb
> tar xf control.tar.gz
> cat control | grep Depends
Depends: libmysqlclient-dev (= 5.7.11-1debian8)

If you have too much uninstalled dependencies, I recommend you to install the GPG key of that debian repository and add the source to /etc/apt/sources.list as described by the provider of that binary package.

A Quick Guide to Using the MySQL APT Repository

This is the line, that you should add to /etc/apt/sources.list or any .list file insde /etc/apt/sources.list.d/:

deb http://repo.mysql.com/apt/debian jessie mysql-5.7

To install the MySQL GPG Public key you can run:

> gpg --recv-keys 5072E1F5
> gpg --export 5072E1F5 > /etc/apt/trusted.gpg.d/5072E1F5.gpg

After running apt-get update you should be able to install the package you want using dpkg -i and even running apt-get install libmysqld-dev

  • 1
    Could you please provide the exact lines that I need to insert into /etc/apt/sources.list? I'm completely dumb at this task. – Lewis Feb 7 '16 at 5:23
  • 1
    have you tried it by typing sudo apt-get install mysql-server ? You can Create a file named /etc/apt/sources.list.d/mysql.list and put into it repository entries in the following format: _deb repo.mysql.com/apt{debian|ubuntu}/ {jessie|wheezy|precise|trusty|utopic|vivid} {mysql-5.6|mysql-5.7|workbench-6.2|utilities-1.4|connector-python-2.0} _ – Ramesh Chand Feb 7 '16 at 5:35
  • @Tresdin Yes ↑ :D – ncomputers Feb 7 '16 at 5:37
  • 1
    @ncomputers.org I got the error after running apt-get update GPG error: http://repo.mysql.com jessie InRelease: The following signatures couldn't be verified because the public key is not available NO_PUBKEY 8C718D3B5072E1F5 – Lewis Feb 7 '16 at 16:04
  • 2
    @ncomputers.org I ran gpg --recv-keys 5072E1F5 and it returned an keyserver failed error. I ran it for a second time and it finally works. dpkg -i still fails with same error but apt-get install works fine. BTW, do you know the reason behind this error? Is it a MySQL APT repo error or a system one? Thanks. – Lewis Feb 8 '16 at 6:58
0

I was having this same issue on my servers. Some of my database boxes took the 5.7.11 patch with no issues and others produced the same error you have gotten. Also if this were an upgrade try commenting out any ssl settings in my.cnf before resorting to the below.

I tried all sorts of fixes but the only one that resolved it was to purge all of mysql except the data directory.

Backup your data first. Tell it to keep your data dir and have a copy of your config dir under home or off the box. You will need to replace it when finished.

My Fix:

su
apt-get remove --purge mysql\*
apt-get autoremove
apt-get autoclean
deluser mysql
apt-get dist-upgrade
reboot

Reinstall mysql apt repo:

dpkg -i mysql-apt-config_0.6.0-1_all.deb
#update and install any needed system updates
apt-get update && apt-get upgrade
apt-get install mysql-server mysql-client
#enter new/same root password

You should be good to go.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.