我正在尝试安装 fpart,但出现 mysql 错误:
# apt install fpart
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
linux-aws-headers-4.4.0-1090 linux-aws-headers-4.4.0-1092 linux-aws-headers-4.4.0-1094 linux-aws-headers-4.4.0-1095 linux-aws-headers-4.4.0-1096 linux-aws-headers-4.4.0-1098
linux-aws-headers-4.4.0-1100 linux-aws-headers-4.4.0-1101 linux-aws-headers-4.4.0-1102 linux-aws-headers-4.4.0-1104 linux-aws-headers-4.4.0-1105 linux-aws-headers-4.4.0-1106
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
fpart
0 upgraded, 1 newly installed, 0 to remove and 48 not upgraded.
2 not fully installed or removed.
Need to get 36.2 kB of archives.
After this operation, 119 kB of additional disk space will be used.
Get:1 http://us-east-1.ec2.archive.ubuntu.com/ubuntu xenial/universe amd64 fpart amd64 0.9.2-1 [36.2 kB]
Fetched 36.2 kB in 0s (318 kB/s)
Selecting previously unselected package fpart.
(Reading database ... 358221 files and directories currently installed.)
Preparing to unpack .../fpart_0.9.2-1_amd64.deb ...
Unpacking fpart (0.9.2-1) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up mysql-server-5.7 (5.7.30-0ubuntu0.16.04.1) ...
insserv: warning: current start runlevel(s) (empty) of script `mysql' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `mysql' overrides LSB defaults (0 1 6).
mysql_upgrade: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) while connecting to the MySQL server
Upgrade process encountered error and will not continue.
mysql_upgrade failed with exit status 11
dpkg: error processing package mysql-server-5.7 (--configure):
subprocess installed post-installation script returned error exit status 1
No apport report written because the error message indicates its a followup error from a previous failure.
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.7; however:
Package mysql-server-5.7 is not configured yet.
dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured
Setting up fpart (0.9.2-1) ...
Errors were encountered while processing:
mysql-server-5.7
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
显然,列表中没有mysql这样的依赖:
# apt depends fpart
fpart
Depends: libc6 (>= 2.4)
Depends: rsync (>= 3.1.1)
Depends: sudo (>= 1.8.12)
这种行为的原因可能是什么?也许有未完成的 MySQL 安装?
# apt list --installed | grep -i mysql
dbconfig-mysql/xenial,now 2.0.4ubuntu1 all [installed,automatic]
mysql-client/xenial-updates,xenial-security,now 5.7.30-0ubuntu0.16.04.1 all [installed]
mysql-client-5.7/xenial-updates,xenial-security,now 5.7.30-0ubuntu0.16.04.1 amd64 [installed,automatic]
mysql-client-core-5.7/xenial-updates,xenial-security,now 5.7.30-0ubuntu0.16.04.1 amd64 [installed,automatic]
mysql-common/xenial-updates,xenial-security,now 5.7.30-0ubuntu0.16.04.1 all [installed]
mysql-server/xenial-updates,xenial-security,now 5.7.30-0ubuntu0.16.04.1 all [installed]
mysql-server-5.7/xenial-updates,xenial-security,now 5.7.30-0ubuntu0.16.04.1 amd64 [installed,automatic]
mysql-server-core-5.7/xenial-updates,xenial-security,now 5.7.30-0ubuntu0.16.04.1 amd64 [installed,automatic]
php-mysql/xenial-updates,now 1:7.0+35ubuntu6.1 all [installed]
php7.0-mysql/xenial-updates,xenial-security,now 7.0.33-0ubuntu0.16.04.15 amd64 [installed,automatic]
所以# ps aux | grep -i mysql | grep -v grep
MySQL 没有运行
看起来 MySQL 升级过程失败了。
如果您修改了 MySQL 系统用户,则升级可能会失败,因为它无法通过 MySQL 套接字进行身份验证。
另一种可能是您的 MySQL 服务器没有运行,因此升级过程无法连接到服务器。