Ubuntu 19.04 容易破壞依賴關係:mono

Ubuntu 19.04 容易破壞依賴關係:mono

我在 ubuntu 19.04 上遇到了 apt 問題。每次我嘗試安裝或升級 apt 軟體包時都會出現以下錯誤:

You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 mono-complete : Depends: mono-roslyn (= 6.4.0.198-0xamarin3+ubuntu1804b1) but it is not going to be installed
 mono-devel : Depends: mono-roslyn (= 6.4.0.198-0xamarin3+ubuntu1804b1) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

運行時sudo apt -f install我遇到以下錯誤:

dpkg: error processing archive /var/cache/apt/archives/mono-roslyn_6.4.0.198-0xamarin3+ubuntu1804b1_all.deb (--unpack):
 trying to overwrite '/usr/bin/csc', which is also in package chicken-bin 4.13.0-1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/mono-roslyn_6.4.0.198-0xamarin3+ubuntu1804b1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

簡而言之:mono-roslyn正在嘗試覆寫目前由(雞方案編譯器)csc使用的二進位。chicken-bin

我嘗試將csc二進位檔案從移動/usr/bin/csc到 來/usr/bin/csc-chicken檢查是否可以解決問題。它沒有,而且我仍然出現同樣的錯誤。

我之前遇到過有關 apt 和 mono 的問題,我用 修復了它sudo apt autoremove, with 給了我與此處顯示的第一個錯誤相同的錯誤。

我需要解決此問題,以便能夠在我的系統上升級或安裝新軟體包。正如你可以想像的那樣,這是一個相當緊迫的問題。

答案1

幾天後我找到了解決方案。我決定刪除,chicken-bin以便單聲道可以正確安裝(不理想,但我最好的選擇)。正如我在問題中所說的那樣apt remove,這是行不通的,但我發現我可以使用dpkg.

以下命令解決了我的問題:

$ sudo dpkg --remove --force-remove-reinstreq chicken-bin
$ sudo apt -f install

希望其他人發現這很有用。

相關內容