小鱼 ROS 2 新书上线!点击链接查看, 新书配套视频点击链接查看。
提问前必看的发帖注意事项—— 提问前必看!不符合要求的问题拒绝回答!!
社区使用指南—如何添加标签修改密码
Ubuntu16.04安装ROS kinetic失败
-
求解Ubuntu16.04安装ROS kinetic中的依赖问题
背景
我在win系统上用WSL2安装了Ubuntu子系统,然后像试试在这个平台上安装ROS控制我的pepper机器人运动。
问题描述
安装ROS失败了。安装的过程总是会报依赖错误,如下。
The following packages have unmet dependencies: ros-kinetic-desktop-full : Depends: ros-kinetic-desktop but it is not going to be installed Depends: ros-kinetic-perception but it is not going to be installed Depends: ros-kinetic-simulators but it is not going to be installed Depends: ros-kinetic-urdf-tutorial but it is not going to be installed
怀疑子系统问题
在CSDN上看到有其他人用子系统安装成功,所以我想应该不是这个原因。
尝试使用aptitude
有尝试使用aptitude进行安装,但是在ubuntu上好像aptitude会和apt产生冲突,安装了aptitude了,apt会被自动卸载掉。然后aptitude会报这样的错误。
E: The method driver /usr/lib/apt/methods/http could not be found. The following actions will resolve these dependencies:
好像和 apt 的 HTTP 方法驱动程序缺失有关。但apt被aptitude干掉了。后边是卸载了aptitude,重新装回了apt。
尝试修改镜像
因为我这边已经配置过清华镜像了,所以这里镜像的选项没有改。
(之前也试过一件更换镜像,最终也都是卡在依赖问题这里)完整的日志:
zzy@PV-X00255684:/mnt/e/subSystemLinux/pkg$ su root Password: root@PV-X00255684:/mnt/e/subSystemLinux/pkg# wget http://fishros.com/install -O fishros && . fishros --2024-08-30 13:27:08-- http://fishros.com/install Resolving fishros.com (fishros.com)... 47.119.165.169 Connecting to fishros.com (fishros.com)|47.119.165.169|:80... connected. HTTP request sent, awaiting response... 301 Moved Permanently Location: http://fishros.com/install/ [following] --2024-08-30 13:27:08-- http://fishros.com/install/ Reusing existing connection to fishros.com:80. HTTP request sent, awaiting response... 200 OK Length: 579 [application/octet-stream] Saving to: ‘fishros’ fishros 100%[=========================================================>] 579 --.-KB/s in 0s 2024-08-30 13:27:08 (48.9 MB/s) - ‘fishros’ saved [579/579] Reading package lists... Done Building dependency tree Reading state information... Done sudo is already the newest version (1.8.16-0ubuntu1.10). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Reading package lists... Done Building dependency tree Reading state information... Done Package python3-distro is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package 'python3-distro' has no installation candidate --2024-08-30 13:27:09-- http://mirror.fishros.com/install/tools/base.py Resolving mirror.fishros.com (mirror.fishros.com)... 47.119.165.169 Connecting to mirror.fishros.com (mirror.fishros.com)|47.119.165.169|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 44650 (44K) [application/octet-stream] Saving to: ‘/tmp/fishinstall/tools/base.py’ /tmp/fishinstall/tools/base.py 100%[=========================================================>] 43.60K --.-KB/s in 0.08s 2024-08-30 13:27:09 (550 KB/s) - ‘/tmp/fishinstall/tools/base.py’ saved [44650/44650] WARN:No Yaml Module! Run CMD Task:[dpkg --print-architecture] [-]Result:success Run CMD Task:[wget https://fishros.org.cn/forum/topic/1733 -O /tmp/t1733 -q && rm -rf /tmp/t1733] [-]Result:code:8 基础检查通过... =============================================================================== ======欢迎使用一键安装工具,人生苦短,三省吾身,省时省力省心!======= ======一键安装已开源,请放心使用:https://github.com/fishros/install ======= =============================================================================== .-~~~~~~~~~-._ _.-~~~~~~~~~-. __.' ~. .~ `.__ .'// 开卷有益 \./ 书山有路 \ `. .'// 可以多看看小鱼的文章 | 关注公众号鱼香ROS \ `. .'// .-~~~~~~~~~~~~~~-._ | _,-~~~~~~~~~~~. \`. .'//.-" `-. | .-' "-.\`. .'//______.============-.. \ | / ..-============.______\`. .'______________________________\|/______________________________` ---------------------------------------------------------------------- RUN Choose Task:[请输入括号内的数字] ---众多工具,等君来用--- ROS相关: [1]:一键安装(推荐):ROS(支持ROS/ROS2,树莓派Jetson) [3]:一键安装:rosdep(小鱼的rosdepc,又快又好用) [4]:一键配置:ROS环境(快速更新ROS环境设置,自动生成环境选择) [9]:一键安装:Cartographer(18 20测试通过,16未测. updateTime 20240125) [11]:一键安装:ROS Docker版(支持所有版本ROS/ROS2) [16]:一键安装:系统自带ROS (!!警告!!仅供特殊情况下使用) 常用软件: [2]:一键安装:github桌面版(小鱼常用的github客户端) [6]:一键安装:NodeJS环境 [7]:一键安装:VsCode开发工具 [8]:一键安装:Docker [10]:一键安装:微信(可以在Linux上使用的微信) [12]:一键安装:PlateformIO MicroROS开发环境(支持Fishbot) [14]:一键安装:科学上网代理工具 [15]:一键安装:QQ for Linux 配置工具: [5]:一键配置:系统源(更换系统源,支持全版本Ubuntu系统) [13]:一键配置:python国内源 [17]:一键配置: Docker代理(支持VPN+代理服务两种模式) [0]:quit 请输入[]内的数字以选择:1 --2024-08-30 13:27:19-- http://mirror.fishros.com/install/tools/tool_install_ros.py Resolving mirror.fishros.com (mirror.fishros.com)... 47.119.165.169 Connecting to mirror.fishros.com (mirror.fishros.com)|47.119.165.169|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 19723 (19K) [application/octet-stream] Saving to: ‘/tmp/fishinstall/tools/tool_install_ros.py’ /tmp/fishinstall/tools/tool_inst 100%[=========================================================>] 19.26K --.-KB/s in 0.03s 2024-08-30 13:27:19 (633 KB/s) - ‘/tmp/fishinstall/tools/tool_install_ros.py’ saved [19723/19723] --2024-08-30 13:27:19-- http://mirror.fishros.com/install/tools/tool_config_rosenv.py Resolving mirror.fishros.com (mirror.fishros.com)... 47.119.165.169 Connecting to mirror.fishros.com (mirror.fishros.com)|47.119.165.169|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 2455 (2.4K) [application/octet-stream] Saving to: ‘/tmp/fishinstall/tools/tool_config_rosenv.py’ /tmp/fishinstall/tools/tool_conf 100%[=========================================================>] 2.40K --.-KB/s in 0s 2024-08-30 13:27:19 (207 MB/s) - ‘/tmp/fishinstall/tools/tool_config_rosenv.py’ saved [2455/2455] --2024-08-30 13:27:19-- http://mirror.fishros.com/install/tools/tool_config_system_source.py Resolving mirror.fishros.com (mirror.fishros.com)... 47.119.165.169 Connecting to mirror.fishros.com (mirror.fishros.com)|47.119.165.169|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 7738 (7.6K) [application/octet-stream] Saving to: ‘/tmp/fishinstall/tools/tool_config_system_source.py’ /tmp/fishinstall/tools/tool_conf 100%[=========================================================>] 7.56K --.-KB/s in 0s 2024-08-30 13:27:19 (15.3 MB/s) - ‘/tmp/fishinstall/tools/tool_config_system_source.py’ saved [7738/7738] 欢迎使用一键安装ROS和ROS2,支持树莓派Jetson,本工具由作者小鱼提供 欢迎使用ROS开箱子工具,本工具由[鱼香ROS]小鱼贡献.. 小鱼:检测当前系统ubuntu16.04:xenial 支持一键安装ROS =========接下来这一步很很很很重要,如果不知道怎么选请选择1======== RUN Choose Task:[请输入括号内的数字] 新手或首次安装一定要一定要一定要换源并清理三方源,换源!!!系统默认国外源容易失败!! [0]:quit [1]:更换系统源再继续安装 [2]:不更换继续安装 请输入[]内的数字以选择:2 Run CMD Task:[sudo apt update] [-]Result:success enial-security InReleases InRelease Run CMD Task:[sudo apt search curl ] [\] This package retrieves data from url-format files such as http://, ftp://, package:// file://, etc., and loads the data into m[/] This package retrieves data from url-format files such as http://, ftp://, package:// file://, etc., and loads the data into m[-]Result:success 3 amd64dock app0.12-5ubuntu3.2 amd644amd64 Run CMD Task:[sudo apt install curl -y] [-]Result:success e and 0 not upgraded. Run CMD Task:[sudo apt search gnupg2 ] [-]Result:success ent (dummy transitional package) Run CMD Task:[sudo apt install gnupg2 -y] [-]Result:success e and 0 not upgraded. Run CMD Task:[curl -s https://gitee.com/ohhuo/rosdistro/raw/master/ros.asc | sudo apt-key add -] [-]Result:success Run CMD Task:[dpkg --print-architecture] [-]Result:success 根据您的系统,为您推荐安装源为['http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu/', 'http://mirrors.tuna.tsinghua.edu.cn/ros2/ubuntu/'] 创建文件:/etc/apt/sources.list.d/ros-fish.list Run CMD Task:[sudo apt update] [-]Result:success n/ros/ubuntu xenial/main amd64 Packages [854 kB]] Run CMD Task:[sudo apt search ros-base ] [/] A metapackage which extends ros_core and includes other basic non-robot tools like actionlib, dynamic reconfigure, nodelets, a[-] A metapackage which extends ros_core and includes other basic non-robot tools like actionlib, dynamic reconfigure, nodelets, a[-]Result:success 恭喜,成功添加ROS源,接下来可以使用apt安装ROS或者使用[1]一键安装ROS安装! Run CMD Task:[sudo apt search ros-base ] [/] A metapackage which extends ros_core and includes other basic non-robot tools like actionlib, dynamic reconfigure, nodelets, a[-] A metapackage which extends ros_core and includes other basic non-robot tools like actionlib, dynamic reconfigure, nodelets, a[-]Result:success RUN Choose Task:[请输入括号内的数字] 请选择你要安装的ROS版本名称(请注意ROS1和ROS2区别): [0]:quit [1]:kinetic(ROS1) [2]:lunar(ROS2) [3]:ardent(ROS2) 请输入[]内的数字以选择:1 RUN Choose Task:[请输入括号内的数字] 请选择安装的具体版本(如果不知道怎么选,请选1桌面版): [0]:quit [1]:kinetic(ROS1)桌面版 [2]:kinetic(ROS1)基础版(小) 请输入[]内的数字以选择:1 Run CMD Task:[sudo apt install ros-kinetic-desktop-full -y] Reading package lists... Done Building dependency tree 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: ros-kinetic-desktop-full : Depends: ros-kinetic-desktop but it is not going to be installed Depends: ros-kinetic-perception but it is not going to be installed Depends: ros-kinetic-simulators but it is not going to be installed Depends: ros-kinetic-urdf-tutorial but it is not going to be installed E: Unable to correct problems, you have held broken packages. Run CMD Task:[sudo apt install ros-kinetic-desktop-full -y] [-]Result:code:100 inetic-urdf-tutorial but it is not going to be installed ============================================================ 请注意我,检测你在安装过程中出现依赖问题,请在稍后输入n,再选择y,即可解决(若无法解决,清在稍后手动运行命令: sudo aptitude install ros-kinetic-desktop-full) 确认了解情况,请输入回车继续安装 Run CMD Task:[sudo apt install ros-kinetic-desktop-full] Reading package lists... Done Building dependency tree 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: ros-kinetic-desktop-full : Depends: ros-kinetic-desktop but it is not going to be installed Depends: ros-kinetic-perception but it is not going to be installed Depends: ros-kinetic-simulators but it is not going to be installed Depends: ros-kinetic-urdf-tutorial but it is not going to be installed E: Unable to correct problems, you have held broken packages. Run CMD Task:[sudo apt install ros-kinetic-desktop-full -y] [-]Result:code:100 inetic-urdf-tutorial but it is not going to be installed Run CMD Task:[sudo apt search python-catkin-tools ] [-]Result:success kin.0.6.1-1 all [installed] Run CMD Task:[sudo apt install python-catkin-tools -y] [-]Result:success e and 0 not upgraded. Run CMD Task:[sudo apt search python-rosdep ] [-]Result:success for ROS-1 all Run CMD Task:[sudo apt install python-rosdep -y] [-]Result:success 1) .....l.deb ....deb .....64 python-rosdep all 0.21.0-1 [3,236 B]51.5 kB]B] Run CMD Task:[ls /opt/ros/kinetic/setup.bash] [-]Result:code:2 安装失败了,请打开鱼香社区:https://fishros.org.cn/forum 在一键安装专区反馈问题... Run CMD Task:[ls /opt/ros/kinetic/setup.bash] [-]Result:code:2 欢迎加入机器人学习交流QQ群:438144612(入群口令:一键安装) 鱼香小铺正式开业,最低499可入手一台能建图会导航的移动机器人,淘宝搜店:鱼香ROS 或打开链接查看:https://item.taobao.com/item.htm?id=696573635888 如在使用过程中遇到问题,请打开:https://fishros.org.cn/forum 进行反馈 root@PV-X00255684:/mnt/e/subSystemLinux/pkg#
请各位大佬能帮忙看看?
-
在Windows Subsystem for Linux (WSL) 上安装 ROS(尤其是较旧版本如 ROS Kinetic)可能会遇到一些依赖问题,因为 WSL 并不总是完全等同于传统的 Linux 环境。这里有几个步骤和建议可以帮助你解决安装 ROS Kinetic 时遇到的问题:
-
确认依赖关系:
ROS Kinetic 需要特定的依赖包,而这些包可能不在默认的 WSL 仓库中。首先确保你的系统源是最新的,并且已经包含了 ROS 的依赖。你已经尝试使用清华的源,这是一个好的开始。 -
使用
aptitude
:
虽然你提到aptitude
和apt
之间的冲突,但aptitude
在解决依赖问题上通常更强大。你可以尝试临时安装aptitude
,解决依赖问题后,再卸载它(如果确实需要的话)。在 WSL 中,你可以使用如下命令来安装aptitude
(如果它还没有被卸载apt
):sudo apt-get install aptitude sudo aptitude install ros-kinetic-desktop-full
如果
aptitude
解决了问题,你可以考虑保留它,或者再次使用apt-get
卸载它(如果需要)。 -
检查 Python 版本:
ROS Kinetic 支持 Python 2.7。确保你的 WSL 系统中的 Python 版本与之兼容。在 WSL 中,你可以通过运行python --version
和python3 --version
来检查 Python 的版本。如果默认 Python 版本是 Python 3,你可能需要安装 Python 2.7 并设置适当的别名或链接。 -
检查 ROS 源:
确保你的 ROS 源是正确的。你已经添加了清华的源,这是一个很好的选择。但请确保没有其他的 ROS 源可能导致冲突。 -
手动安装依赖:
如果自动安装失败,你可以尝试手动安装那些缺失的依赖。这通常涉及到查找每个缺失包的依赖,并使用apt-get install
或aptitude install
来安装它们。 -
考虑使用 ROS Noetic:
如果可能,考虑使用 ROS Noetic 而不是 Kinetic。ROS Noetic 是 ROS 1 的最新长期支持版本,它支持 Python 3,并且与 WSL 的兼容性可能更好。 -
查看 WSL 的限制:
请注意,WSL 可能不完全支持 ROS 的所有功能,特别是那些需要硬件交互(如机器人硬件)的功能。如果你需要这些功能,考虑在虚拟机或双启动的 Linux 环境中安装 ROS。 -
查看社区和文档:
查看 ROS 社区和文档,看看是否有其他人遇到并解决了类似的问题。这可以帮助你找到解决方案或工作区。
希望这些步骤和建议能帮助你解决在 WSL 上安装 ROS Kinetic 时遇到的问题!
以上为生成回答,仅供参考~
-