Ubuntu 17.04-can';t安装mysql-server-5.6

Ubuntu 17.04-can';t安装mysql-server-5.6,ubuntu,package,apt,Ubuntu,Package,Apt,我到处找这个,但都没找到。 运行时: sudo apt-get install mysql-server-5.6 我得到这个结果: 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 impossib

我到处找这个,但都没找到。 运行时:

sudo apt-get install mysql-server-5.6
我得到这个结果:

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: mysql-client-5.6 (>= 5.6.16-1~exp1) but it is not going to be installed
                    Depends: mysql-server-core-5.6 (= 5.6.16-1~exp1) but it is not going to be installed
                    Depends: sysv-rc (>= 2.88dsf-24) but it is not installable or
                             file-rc (>= 0.8.16) but it is not installable
E: Unable to correct problems, you have held broken packages.
我还尝试:

sudo aptitude install mysql-server
它试图通过以下方式解决这个问题:

     Keep the following packages at their current version:
1)     mysql-client-5.6 [Not Installed]                   
2)     mysql-client-core-5.6 [Not Installed]              
3)     mysql-server-5.6 [Not Installed]                   
4)     mysql-server-core-5.6 [Not Installed]              
但这也不行

dpkg --get-selections | grep hold
在dpkg命令下,没有任何东西处于命令上方。 此外,任何其他升级/更新或删除/清除任何mysql实例都没有帮助。 谢谢

编辑-1
在清除mysql*并使用aptitude重新安装之后,我将消除一些依赖项。持久依赖项是initscriptssysv rc文件rc。Ubuntu 17.04只提供MySQL 5.7的软件包,该软件包存在一系列向后兼容性问题,代码是针对较旧的MySQL版本编写的

Oracle维护了MySQL 5.6的官方APT存储库列表,但这些存储库还不支持Ubuntu17.04(截至撰写本文时)。这是一个在ubuntu以前版本中一直存在的问题

要解决此问题,请从删除/卸载所有现有mysql模块开始。要获取已安装mysql模块的列表,请使用以下命令:

dpkg -l | grep mysql
从下载apt_config-debian包(
mysql-apt-config_0.7.3-1_all.deb
),并使用以下方法安装:

sudo dpkg -i mysql-apt-config_0.7.3-1_all.deb
使用此内容创建一个新文件
/etc/apt/preferences.d/mysql

Package: *
Pin: origin "repo.mysql.com"
Pin-Priority: 999
运行以下命令更新缓存

sudo apt update
运行以下命令安装MySQL

sudo apt install mysql-client mysql-server libmysqlclient-dev
你应该得到5.6版本


此解决方案已被详细讨论,以防您需要更多详细信息,或者遇到一些问题。

尝试此apt get install-f或单击此[此处]()已厌倦此帖子:]谢谢!我认为这是没有希望的,所以我继续用Percona。虽然你的答案听起来很有希望,但我保证会在需要时尽快尝试并给你反馈。无论如何,我感谢你的时间和努力!!要卸载现有软件包:
sudo apt get purge php7.3-mysql