在 16.04 上安裝 ubuntu-sdk 時出現相依性問題

在 16.04 上安裝 ubuntu-sdk 時出現相依性問題

在全新安裝 Ubuntu 16.04 64 位元時安裝 ubuntu-sdk 時出現此錯誤:

The following packages have unmet dependencies:
 ubuntu-sdk : Depends: ubuntu-sdk-libs-dev but it is not going to be installed
              Depends: autopilot-desktop but it is not installable
              Depends: intltool but it is not installable
              Depends: libcontent-hub-doc but it is not installable
              Depends: phablet-tools but it is not going to be installed
              Depends: ubuntu-device-flash but it is not going to be installed
              Depends: ubuntu-sdk-ide but it is not going to be installed
E: Unable to correct problems, you have held broken packages.`

如何解決這個問題。

答案1

需要把一些依賴項單獨安裝。就我而言,它拋出的是:

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:
 ubuntu-sdk : Depends: phablet-tools but it is not going to be installed
              Depends: ubuntu-sdk-ide but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

所以我首先嘗試安裝 phablet-tools :

sudo apt install phablet-tools

它拋出:

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:
 phablet-tools : Depends: android-tools-adb (>= 4.2.2)
                 Depends: android-tools-fastboot (>= 4.2.2)
E: Unable to correct problems, you have held broken packages.

所以我接著使用以下指令一一安裝 android-tools-adb 和 android-tools-fastboot :

sudo apt install android-tools-adb
sudo apt install android-tools-fastboot

然後我再次嘗試使用以下命令安裝 ubuntu-sdk:

sudo apt install ubuntu-sdk

它奏效了。

所以重點是,你必須一一安裝所有依賴項。它適用於您想要安裝的任何軟體包,而不僅僅是 ubuntu-sdk。

答案2

如果您在安裝 sdk 時遇到諸如未滿足依賴項之類的錯誤,則需要安裝錯誤中提到的所有依賴項。最後安裝ubuntu-sdk。效果很好。

相關內容