keac's Bolg.

Ubuntu 安装 libmysqld-dev

字数统计: 549阅读时长: 3 min
2020/02/15 Share

安装提示缺少libmysqld,随即安装

apt-get install libmysqld-dev

报错了,来fix看看

1
2
3
4
5
6
7
8
Reading package lists... Done
Building dependency tree
Reading state information... Done
libmysqld-dev is already the newest version (5.7.29-0ubuntu0.18.04.1).
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
libmysqld-dev : Depends: libmysqlclient-dev (>= 5.7.29-0ubuntu0.18.04.1) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

apt --fix-broken install

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
libopts25 sntp
Use 'apt autoremove' to remove them.
The following additional packages will be installed:
libmysqlclient-dev
The following NEW packages will be installed:
libmysqlclient-dev
0 upgraded, 1 newly installed, 0 to remove and 157 not upgraded.
31 not fully installed or removed.
Need to get 0 B/992 kB of archives.
After this operation, 6,012 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 122050 files and directories currently installed.)
Preparing to unpack .../libmysqlclient-dev_5.7.29-0ubuntu0.18.04.1_amd64.deb ...
Unpacking libmysqlclient-dev (5.7.29-0ubuntu0.18.04.1) ...
dpkg: error processing archive /var/cache/apt/archives/libmysqlclient-dev_5.7.29-0ubuntu0.18.04.1_amd64.deb (--unpack):
unable to open '/usr/include/mysql/plugin.h.dpkg-new': No such file or directory
Errors were encountered while processing:
/var/cache/apt/archives/libmysqlclient-dev_5.7.29-0ubuntu0.18.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

unable to open '/usr/include/mysql/plugin.h.dpkg-new': No such file or directory

看提示是缺少了东西,目录上面也没有,Google 了半天也没找着解决方法。

我们先看看缺少的这个文件在哪里有

find / | grep plugin.h

我这里的mysql是宝塔的环境,可以看到这个在/www/server/mysql/include/下面

1
2
3
4
5
6
7
/www/server/php/72/include/php/ext/mysqlnd/mysqlnd_ext_plugin.h
/www/server/php/72/include/php/ext/mysqlnd/mysqlnd_plugin.h
/www/server/php/72/src/ext/mysqlnd/mysqlnd_ext_plugin.h
/www/server/php/72/src/ext/mysqlnd/mysqlnd_plugin.h
/www/server/mysql/include/mysql/client_plugin.h.pp
/www/server/mysql/include/mysql/client_plugin.h
/www/server/mysql/include/plugin.h

ls -al /usr/include/mysql

xxx

先删掉这个链接 rm /usr/include/mysql/mysql

xxx

ln -s /www/server/mysql/include /usr/include/mysql/mysql

xxx

再执行apt --fix-broken install

xxx

CATALOG