我最近尝试安装 MySQL 服务器,但是遇到了这个错误:
E: 子进程 /usr/bin/dpkg 返回错误代码 (1)
这是我尝试安装 MySQL 服务器的操作:
sudo apt-get install mysql-server
但输入此命令后我收到此错误:
dev@webos-develop:/var/lib/dpkg/info$ sudo apt-get install mysql-
server
Reading package lists... Done
Building dependency tree
Reading state information... Done
mysql-server is already the newest version.
The following packages were automatically installed and are no longer required:
gnome-video-effects gyp libc-ares-dev libc-ares2 libjs-inherits libjs-jquery
libjs-node-uuid libjs-underscore libv8-3.14-dev libv8-3.14.5 node-abbrev
node-ansi node-ansi-color-table node-archy node-async node-block-stream
node-combined-stream node-cookie-jar node-delayed-stream node-forever-agent
node-form-data node-fstream node-fstream-ignore node-github-url-from-git
node-glob node-graceful-fs node-gyp node-inherits node-ini
node-json-stringify-safe node-lockfile node-lru-cache node-mime
node-minimatch node-mkdirp node-mute-stream node-node-uuid node-nopt
node-normalize-package-data node-npmlog node-once node-osenv node-qs
node-read node-read-package-json node-request node-retry node-rimraf
node-semver node-sha node-sigmund node-slide node-tar node-tunnel-agent
node-underscore node-which
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up mysql-server-5.6 (5.6.25-0ubuntu1) ...
/var/lib/dpkg/info/mysql-server-5.6.postinst: line 95: /usr/share/mysql-common/configure-symlinks: No such file or directory
dpkg: error processing package mysql-server-5.6 (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.6; however:
Package mysql-server-5.6 is not configured yet.
dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
mysql-server-5.6
mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
在我用过之后
apt-cache policy mysql-server mysql-common
我得到的输出为
mysql-server:
Installed: 5.6.25-0ubuntu1
Candidate: 5.6.25-0ubuntu1
Version table:
*** 5.6.25-0ubuntu1 0
500 http://in.archive.ubuntu.com/ubuntu/ wily/main amd64 Packages
100 /var/lib/dpkg/status
mysql-common:
Installed: 10.1.16+maria-1~wily
Candidate: 10.1.16+maria-1~wily
Version table:
*** 10.1.16+maria-1~wily 0
500 http://nyc2.mirrors.digitalocean.com/mariadb/repo/10.1/ubuntu/ wily/main amd64 Packages
100 /var/lib/dpkg/status
5.6.25-0ubuntu1 0
500 http://in.archive.ubuntu.com/ubuntu/ wily/main amd64 Packages
答案1
/usr/share/mysql-common/configure-symlinks: No such file or directory
看:https://bugs.launchpad.net/ubuntu/+source/mysql-5.6/+bug/1455818 根据错误报告,该问题已在 5.6.27 版本中修复。
更新:OP 说他使用的是 Ubuntu 15.10,尽管他的问题中有一个标签 14.04。
虽然 15.10 已停止服务,但您仍可以使用 MySQL 5.6.31 版本 https://launchpad.net/ubuntu/wily/+package/mysql-server
您发布的 sources.list 文件行显示 xenial (16.04)。我相信您升级了系统。我希望现在一切正常 :)