2016-02-08 194 views
0

我想在Debian 7 Wheezy上安装MySql 5.7。我把:在Debian 7上安装MySQL 5.7 Wheezy

deb http://repo.mysql.com/apt/debian/ wheezy mysql-5.7 

文件:

/etc/apt/sources.list.d/mysql.list 

下一页我运行命令:

sudo apt-get update 
sudo apt-get upgrade 

并试图安装包:

sudo apt-get install mysql-server-5.7 

我得到了一个错误:

Reading package lists... Done 
Building dependency tree  
Reading state information... Done 
Note, selecting 'mysql-community-server' instead of 'mysql-server-5.7' 
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-community-server : Depends: mysql-common (= 5.7.11-1debian7) but 5.5.47-0+deb7u1 is to be installed 
          Depends: mysql-client (= 5.7.11-1debian7) 
E: Unable to correct problems, you have held broken packages. 

你有什么想法来解决这个问题吗? 我也试过:

Note, selecting 'mysql-community-server' instead of 'mysql-server-5.7' 

但它不是问题的解决方案。

回答

0

你并不需要在apt-get命令,只需键入指定版本:

sudo apt-get install mysql-server 

安装后,您可以键入以下命令来检查MySQL版本

aptitude show mysql-server 

在我的机器,我有以下结果:

... 
Version : 5.7.13-1debian7 
... 
+1

非常愚蠢的答案...我解决了这个问题 - 我不得不改变MySQL包的引脚优先级。你必须指定你想要安装的版本,如果它不同于你在apt-cache策略中的默认版本(在这种情况下,它不是干净的debian,但修改版本,所以apt源稍有不同,引脚等)。 – pierogarnia

1

我偶然发现了这篇文章,可以简单地c确认通过使用命令行直接从MySQL Downloads

下载.deb包挂缓存的优先级:

$ cd /usr/src && sudo wget http://dev.mysql.com/get/mysql-apt-config_0.7.3-1_all.deb 

Please note: by convension the /src directory on linux exists for source code to live before being compiled - I believe the deb package above therefore belongs here.

这适用于Debian /喘息。

$ sudo dpkg -i http://dev.mysql.com/get/mysql-apt-config_0.7.3-1_all.deb 

一旦你完成这些步骤走了,你只需点击Ok,然后进行安装mysql-server像正常:

$ sudo apt-get install mysql-server 

对于我来说,这导致了以下内容:

[info] MySQL Community Server 5.7.14 is started. Setting up mysql-server (5.7.14-1debian7) ...

进一步阅读,如果你想删除这个包,你可以这样做:

$ cd /usr/src && sudo dpkg --remove http://dev.mysql.com/get/mysql-apt-config_0.7.3-1_all.deb 
+0

需要在'apt-get install'之前运行'apt-get update'。 – Marwelln