apt-get安裝任何軟件都報錯:E:Unmet dependencies. Try 'apt-get -f install' with no packages

如題,使用apt-get install去安裝任何軟件都報錯這個錯:
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
當我根據提示輸入:sudo apt-get -f install 的時候又出現新的錯誤:E: Sub-process /usr/bin/dpkg returned an error code (1)

折騰了半天,後來覺得應該是我之前在下載一個軟件的時候,不但沒成功安裝還把apt的某些部分搞壞了,其他軟件也下載不了。
於是,進入sudo gedit /etc/apt/sources.list
在文件的末尾看到這幾行:

deb http://mirrors.aliyun.com/debian wheezy main contrib non-free
deb-src http://mirrors.aliyun.com/debian wheezy main contrib non-free
deb http://mirrors.aliyun.com/debian wheezy-updates main contrib non-free
deb-src http://mirrors.aliyun.com/debian wheezy-updates main contrib non-free
deb http://mirrors.aliyun.com/debian-security wheezy/updates main contrib non-free
deb-src http://mirrors.aliyun.com/debian-security wheezy/updates main contrib non-free

問題應該就在這裏了(我用的是ubuntu系統不是debian)。刪除這幾行,再sudo apt-get -f install,恢復正常。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章