概述
Ubuntu 用的是18.04, gazebo 装的是11.
在加载 ros-melodic-desktop-full 时 出现一些中断, 显示:
The following packages have unmet dependencies:
ros-melodic-desktop-full : Depends: ros-melodic-simulators but it is not going to be installed
Depends: ros-melodic-urdf-sim-tutorial but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
解决办法:
先试试更新新的镜像:
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
sudo apt-get update
不成功, 继续找问题,
sudo apt install aptitude
sudo aptitude install ros-melodic-desktop-full
漫长的等待后 查找出了以下问题,
The following actions will resolve these dependencies:
Remove the following packages:
1) ros-melodic-desktop [1.4.1-0bionic.20210219.183826 (bionic, now)]
2) ros-melodic-perception [1.4.1-0bionic.20210206.034851 (bionic, now)]
3) ros-melodic-robot [1.4.1-0bionic.20210112.194420 (bionic, now)]
4) ros-melodic-rqt-common-plugins [0.4.8-0bionic.20210219.183458 (bionic, n
5) ros-melodic-rqt-robot-plugins [0.5.7-0bionic.20210219.183706 (bionic, no
6) ros-melodic-rqt-robot-steering [0.5.10-1bionic.20210112.175500 (bionic,
7) ros-melodic-rviz [1.13.15-1bionic.20210206.031829 (bionic, now)]
8) ros-melodic-stage-ros [1.8.0-0bionic.20210112.190228 (bionic, now)]
9) ros-melodic-urdf-tutorial [0.4.0-0bionic.20210206.035955 (bionic, now)]
Keep the following packages at their current version:
10) gazebo9 [Not Installed]
11) gazebo9-common [Not Installed]
12) gazebo9-plugin-base [Not Installed]
13) libgazebo9 [Not Installed]
14) libgazebo9-dev [Not Installed]
15) ros-melodic-desktop-full [Not Installed]
16) ros-melodic-forward-command-controller [0.17.2-1bionic.20210120.180015 (
17) ros-melodic-gazebo-dev [Not Installed]
18) ros-melodic-gazebo-msgs [Not Installed]
19) ros-melodic-gazebo-plugins [Not Installed]
20) ros-melodic-gazebo-ros [Not Installed]
21) ros-melodic-gazebo-ros-control [Not Installed]
22) ros-melodic-gazebo-ros-pkgs [Not Installed]
23) ros-melodic-kdl-parser [1.13.1-0bionic.20201017.084826 (bionic, now)]
24) ros-melodic-orocos-kdl [1.4.0-0bionic.20201017.031444 (bionic, now)]
25) ros-melodic-simulators [Not Installed]
26) ros-melodic-tf2-kdl [0.6.5-0bionic.20210112.183939 (bionic, now)]
27) ros-melodic-urdf-sim-tutorial [Not Installed]
系统提示的问题接受就好了,(我不知道为什么,)
后面会有很多Removing 起头的代码,不要慌继续等, 直到指令执行完. 接着再试一遍
sudo apt install ros-melodic-desktop-full
还是无法安装,
The following packages have unmet dependencies:
ros-melodic-desktop-full : Depends: ros-melodic-simulators but it is not going to be installed
Depends: ros-melodic-urdf-sim-tutorial but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
两个问题, os-melodic-simulators 和 ros-melodic-urdf-sim-tutorial, 于是手动安装:
sudo aptitude install ros-melodic-simulators
又是一个长时间的等待, 直到程序完成.
再换个相同含义的代码测试一下,看装成功了没
sudo apt install ros-melodic-simulators
这次成功了,
再试试安装 ros-melodic-desktop-full:
sudo apt install ros-melodic-desktop-full
终于进入漫长的安装期,装完后 升级一下,
rosdep update
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
sudo apt install python-rosinstall python-rosinstall-generator python-wstool build-essential
装包具体会怎么用也不是非常明白,反正一路都在排bug, 记录一下自己遇到的bug,万一想重装ubuntu呢,这些问题还会再出现的.
最后
以上就是懵懂水杯为你收集整理的在加载 ros-melodic-desktop-full 时 遇到的错的全部内容,希望文章能够帮你解决在加载 ros-melodic-desktop-full 时 遇到的错所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复