无法在 Ubuntu 16.10 上安装 MySQL 5.6

无法在 Ubuntu 16.10 上安装 MySQL 5.6

我遵循这个指示https://askubuntu.com/a/765458/490870

duke@ostrov:~$ sudo apt install mysql-server-5.6
[sudo] password for duke: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 mysql-server-5.6 : Depends: initscripts but it is not installable
                    Depends: sysv-rc (>= 2.88dsf-24) but it is not installable or
                             file-rc (>= 0.8.16) but it is not installable
                    Recommends: libhtml-template-perl but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
duke@ostrov:~$ sudo rm /var/lib/mysql/debian-5.7.flag
rm: cannot remove '/var/lib/mysql/debian-5.7.flag': No such file or directory

答案1

我也在使用 Ubuntu 16.10,我的电脑中 mysql-server 的默认版本是 5.7,并且运行良好。

尝试以下命令:

    sudo apt-get install -f
    sudo apt-get purge mysql-server-5.6
    sudo apt-get update && sudo apt-get install mysql-server-5.7

如果仍然收到损坏的包裹错误,请尝试sudo dpkg --configure -a修复它。也可能有助于您修复损坏的包裹。

(PS:这可能不起作用,我把我的答案放出来是因为我没有足够的声誉来评论,希望它能帮助你!)

相关内容