在全新安装的 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。它工作正常。