我一直在尝试安装 mysql-server,但是在安装过程中遇到此错误,该如何解决?
sudo aptitude install mysql-server
The following NEW packages will be installed:
mysql-server-5.6{a}
The following partially installed packages will be configured:
mysql-server
0 packages upgraded, 1 newly installed, 0 to remove and 5 not upgraded.
Need to get 0 B/5,744 kB of archives. After unpacking 52.4 MB will be used.
Do you want to continue? [Y/n/?] y
Preconfiguring packages ...
(Reading database ... 387903 files and directories currently installed.)
Preparing to unpack .../mysql-server-5.6_5.6.27-0ubuntu1_amd64.deb ...
Aborting downgrade from (at least) 10.0 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.27-0ubuntu1_amd64.deb (--unpack):
subprocess new pre-installation script returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/mysql-server-5.6_5.6.27-0ubuntu1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Failed to perform requested operation on package. Trying to recover:
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.6; however:
Package mysql-server-5.6 is not installed.
dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
mysql-server
答案1
答案2
错误信息说If are sure you want to downgrade to 5.6, remove the file /var/lib/mysql/debian-*.flag and try installing again.
因此,您可以运行以下命令来解决此问题:
sudo rm /var/lib/mysql/debian-*.flag
sudo apt-get -f install