安装ros2时,我们输入:
sudo apt-get install ros-humble-desktop
可能会出现以下问题:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
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:
libicu-dev : Depends: libicu70 (= 70.1-2) but 70.1-2ubuntu1 is to be installed
zlib1g-dev : Depends: zlib1g (= 1:1.2.11.dfsg-2ubuntu9) but 1:1.2.11.dfsg-2ubuntu9.1 is to be installed
E: Unable to correct problems, you have held broken packages.
中文意思为:
以下软件包还不满足依赖:
libicu-dev : Depends: libicu70 (= 70.1-2) but 70.1-2ubuntu1 将被安装
zlib1g-dev : Depends: zlib1g (= 1:1.2.11.dfsg-2ubuntu9) but 1:1.2.11.dfsg-2ubuntu9.1 将被安装
E: Unable to correct problems, you have held broken packages.
解决办法:
在软件和更新中,把上述选项保持一致
在开发者选项中勾选超前的更新。
之后在终端中:
sudo apt-get update
sudo apt-get upgrade
之后输入:
sudo apt-get install ros-humble-desktop
如下图所示,即可完成安装: