解决deepin配置ros rosdep update detect os失败问题
ERROR: Rosdep experienced an error: Could not detect OS
错误信息
reading in sources list data from /etc/ros/rosdep/sources.list.d
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml
Query rosdistro index https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml
Skip end-of-life distro “ardent”
Skip end-of-life distro “bouncy”
Skip end-of-life distro “crystal”
Add distro “dashing”
ERROR: Rosdep experienced an error: Could not detect OS, tried [‘zorin’, ‘windows’, ‘nixos’, ‘clearlinux’, ‘ubuntu’, ‘slackware’, ‘rhel’, ‘qnx’, ‘pop’, ‘osx’, ‘sailfishos’, ‘tizen’, ‘opensuse’, ‘opensuse’, ‘opensuse’, ‘opensuse’, ‘openembedded’, ‘neon’, ‘mx’, ‘mint’, ‘linaro’, ‘gentoo’, ‘funtoo’, ‘freebsd’, ‘fedora’, ‘elementary’, ‘elementary’, ‘debian’, ‘cygwin’, ‘centos’, ‘manjaro’, ‘arch’, ‘alpine’]
Please go to the rosdep page [1] and file a bug report with the stack trace below.
[1] : http://www.ros.org/wiki/rosdep
rosdep version: 0.19.0
Traceback (most recent call last):
File “/usr/lib/python2.7/dist-packages/rosdep2/main.py”, line 144, in rosdep_main
exit_code = _rosdep_main(args)
File “/usr/lib/python2.7/dist-packages/rosdep2/main.py”, line 428, in _rosdep_main
return _no_args_handler(command, parser, options, args)
File “/usr/lib/python2.7/dist-packages/rosdep2/main.py”, line 437, in _no_args_handler
return command_handlerscommand
File “/usr/lib/python2.7/dist-packages/rosdep2/main.py”, line 649, in command_update
ros_distro=options.ros_distro)
File “/usr/lib/python2.7/dist-packages/rosdep2/sources_list.py”, line 507, in update_sources_list
rosdep_data = get_gbprepo_as_rosdep_data(dist_name)
File “/usr/lib/python2.7/dist-packages/rosdep2/gbpdistro_support.py”, line 150, in get_gbprepo_as_rosdep_data
ctx = create_default_installer_context()
File “/usr/lib/python2.7/dist-packages/rosdep2/init.py”, line 90, in create_default_installer_context
m.register_platforms(context)
File “/usr/lib/python2.7/dist-packages/rosdep2/platforms/debian.py”, line 55, in register_platforms
register_elementary(context)
File “/usr/lib/python2.7/dist-packages/rosdep2/platforms/debian.py”, line 82, in register_elementary
(os_name, os_version) = context.get_os_name_and_version()
File “/usr/lib/python2.7/dist-packages/rosdep2/installers.py”, line 115, in get_os_name_and_version
os_name = self.os_detect.get_name()
File “/usr/lib/python2.7/dist-packages/rospkg/os_detect.py”, line 698, in get_name
self.detect_os()
File “/usr/lib/python2.7/dist-packages/rospkg/os_detect.py”, line 668, in detect_os
raise OsNotDetected(“Could not detect OS, tried %s” % attempted)
OsNotDetected: Could not detect OS, tried [‘zorin’, ‘windows’, ‘nixos’, ‘clearlinux’, ‘ubuntu’, ‘slackware’, ‘rhel’, ‘qnx’, ‘pop’, ‘osx’, ‘sailfishos’, ‘tizen’, ‘opensuse’, ‘opensuse’, ‘opensuse’, ‘opensuse’, ‘openembedded’, ‘neon’, ‘mx’, ‘mint’, ‘linaro’, ‘gentoo’, ‘funtoo’, ‘freebsd’, ‘fedora’, ‘elementary’, ‘elementary’, ‘debian’, ‘cygwin’, ‘centos’, ‘manjaro’, ‘arch’, ‘alpine’]
解决方案
修改/etc/lsb-realse中DISTRIB_ID 为debian,如下图:
但是该文件直接打开是没有权限的,所以继续如下操作
修改权限
打开命令行,输入如下代码:
下面展示一些。
sudo su
然后输入密码,定位到该文件(在home/用户名/etc 文件目录下),输入以下命令 ps:也可直接修改后面为文件路径
chmod 777 lsb-release
然后修改名称即可,再次回到命令行输入即可
rosdep update
然后就可以慢慢等待安装了,后续遇到问题再继续更新
感谢https://blog.csdn.net/xiaoding_ding/article/details/54706046提供思路!