尝试安装 mysql-server-5.6 时“E:子进程 /usr/bin/dpkg 返回错误代码 (1)”

尝试安装 mysql-server-5.6 时“E:子进程 /usr/bin/dpkg 返回错误代码 (1)”

尝试安装 mysql-server-5.6 for 16.04sudo apt -f -y install mysql-server-5.6

but am getting the following return

    WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
Suggested packages:
  mailx tinyca
The following NEW packages will be installed:
  mysql-server-5.6
debconf: unable to initialize frontend: Dialog
debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (This frontend requires a controlling tty.)
debconf: falling back to frontend: Teletype
dpkg-preconfigure: unable to re-open stdin: 
0 upgraded, 1 newly installed, 0 to remove and 12 not upgraded.
Need to get 0 B/5,839 kB of archives.
After this operation, 52.2 MB of additional disk space will be used.
(Reading database ... 
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 97261 files and directories currently installed.)
Preparing to unpack .../mysql-server-5.6_5.6.16-1~exp1_amd64.deb ...
debconf: unable to initialize frontend: Dialog
debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)
debconf: falling back to frontend: Readline
Aborting downgrade from (at least) 5.7 to 5.6.
If are sure you want to downgrade to 5.6, remove the file
/var/lib/mysql/debian-*.flag and try installing again.
dpkg: error processing archive /var/cache/apt/archives/mysql-server-5.6_5.6.16-1~exp1_amd64.deb (--unpack):
 subprocess new pre-installation script returned error exit status 1
debconf: unable to initialize frontend: Dialog
debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)
debconf: falling back to frontend: Readline
Errors were encountered while processing:
 /var/cache/apt/archives/mysql-server-5.6_5.6.16-1~exp1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

答案1

这是错误消息中的重要部分:

Aborting downgrade from (at least) 5.7 to 5.6.
If are sure you want to downgrade to 5.6, remove the file
/var/lib/mysql/debian-*.flag and try installing again.

请删除该文件并重试。然后让我们知道。

相关内容