2016-02-08 170 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