2017-02-09 69 views
0

我意外地從Ubuntu 16.04中刪除了MySQL。現在,當我嘗試再次安裝時,出現錯誤。請大家幫我出這個錯誤:Ubuntu上的MySQL中的安裝錯誤16.04

update-alternatives: error: alternative path /etc/mysql/my.cnf.fallback doesn't exist 
dpkg: error processing package mysql-common (--configure): 
subprocess installed post-installation script returned error exit status 2 
E: Sub-process /usr/bin/dpkg returned an error code (1) 

回答

3

首先開始了與清除使用您的源列表:

sudo rm /etc/apt/source.list 

然後鍵入:

sudo software-properties-gtk 

首先檢查了4盒,選擇服務器(yourcountryname)並點擊恢復。

現在,作爲你的問題比我帶的參考位不同,你應該嘗試運行:

sudo apt-get purge mysql-server mysql-client mysql-common mysql-server-5.7 

這將刪除所有相關的包和相關的MySQL

現在做:

sudo apt-get autoclean 
sudo apt-get update && sudo apt-get upgrade 

這個嘗試後用做全新安裝:

sudo apt-get install mysql-server-5.7 

這可能會解決您的問題。

參考: E: Sub-process /usr/bin/dpkg returned an error code (1) [related to google chrome]

+1

非常感謝。爲我工作! –

+0

@ErkanÖzkök我的快樂。 :) –