![错误 /var/cache/apt/archives/mysql-server-5.5_5.5.40-0ubuntu0.12.04.1_amd64.deb](https://linux22.com/image/867216/%E9%94%99%E8%AF%AF%20%2Fvar%2Fcache%2Fapt%2Farchives%2Fmysql-server-5.5_5.5.40-0ubuntu0.12.04.1_amd64.deb.png)
经过一番折腾并卸载了 mariadb-server 之后,我在安装 mysql-server 时遇到了问题:
root@serv:# apt-get install mysql-server-5.5
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
tinyca mailx
The following NEW packages will be installed:
mysql-server-5.5
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0 B/8,836 kB of archives.
After this operation, 32.7 MB of additional disk space will be used.
Preconfiguring packages ...
(Reading database ... 437852 files and directories currently installed.)
Unpacking mysql-server-5.5 (from .../mysql-server-5.5_5.5.40-0ubuntu0.12.04.1_amd64.deb) ...
Aborting downgrade from (at least) 10.1 to 5.5.
If are sure you want to downgrade to 5.5, remove the file
/var/lib/mysql/debian-*.flag and try installing again.
dpkg: error processing /var/cache/apt/archives/mysql-server-5.5_5.5.40-0ubuntu0.12.04.1_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.5_5.5.40-0ubuntu0.12.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
我也尝试过
apt-get --purge remove mysql-server
和
apt-get -f install
和
apt-get install mysql-server
但结果还是同样的错误。感谢您的提示以解决此问题并安装 mysql-server。
答案1
根据您的错误日志,执行以下操作:
sudo rm -f /var/lib/mysql/debian-*.flag
然后重新安装!