无法安装mysql-server-5.5 /以下软件包有未满足的依赖项

我是新手,所以请耐心等待。

我正在使用ubuntu 14.04。

我尝试使用以下命令输入mysql:

mysql -u root -p 

我收到以下消息:

 The program mysql can be found on the following packages: * mysql-client-core-5.5 * mariadb-client-core-5.5 * mysql-client-core-5.6 * percona-xtrabd-cluster-client-5.5 

然后我输入:

 sudo apt-get install mysql-client-core-5.6 

安装完成后,我尝试使用以下命令再次连接到mysql:

 mysql -u root -p 

然后我收到了错误消息:

 ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) 

在线搜索后,我发现我需要安装mysql服务器,所以我在下面的命令中写道

 sudo apt-get install mysql-server 

然后我收到了消息:

 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 : Depends: mysql-server-5.5 but it is not going to be installed E: Unable to correct problems, you have held broken packages. 

我一直在寻找过去一小时的解决方案,但其他人有类似的错误,但从升级mysql和因此有解决方案对我来说是无效的。

打开终端并输入:

 sudo apt-get purge mysql-client-core-5.6 sudo apt-get autoremove sudo apt-get autoclean sudo apt install mysql-client-core-5.5 sudo apt install mysql-server 

MySQL数据库核心客户端和MySQL服务器包都将是相同的版本5.5。 MySQL Client 5.5和MySQL Server 5.5是Ubuntu 14.04中这些软件包的当前“最佳”版本,由软件包维护者决定。 如果您更愿意安装MySQL Client 5.6和MySQL Server 5.6,您还可以在Ubuntu软件中心找到mysql-client-core-5.6和mysql-server-5.6软件包。 重要的是客户端和服务器版本号在任何一种情况下都匹配。

在Ubuntu 16.04和18.04中,这两个包的名称是mysql-client-core-5.7和mysql-server-5.7。

以下命令解决了我的问题。

 sudo aptitude install mysql-server 

如果您的计算机中未安装aptitude,请首先使用以下命令安装aptitude。

 sudo apt-get install aptitude 

我使用Synaptic Package Manager解决了这个问题。

我发现,在我的情况下,我使用不同版本的MySQL常见,服务器和客户端。

特别是,对于常见的我使用mariabd存储库来获取文件。 我在Synaptic中使用Package> Force版本更改了这一点,并为所有包选择了相同的版本(5.7.12)。

希望这有帮助。

这让我摆脱了绝对可怕的局面,其他事情(例如http://www.debiantutorials.com/install-mysql-server-5-6-debian-7-8/ )让我遇到了未满足的依赖关系和麻烦等等等等。

谢谢!