rosdep init错误
rosdep init 或者rosdep update 连接错误的解决办法
$ rosdep init
ERROR: cannot download default sources list from:
https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list
Website may be down.
上述链接通过浏览器也不能访问
解决方法1
变更nameserver为google服务器
sudo gedit /etc/resolv.conf
将原有的nameserver这一行注释,并添加以下两行,二选一也可:
nameserver 8.8.8.8 #google域名服务器
nameserver 8.8.4.4 #google域名服务器
保存退出,执行
$ sudo rosdep init
Wrote /etc/ros/rosdep/sources.list.d/20-default.list
Recommended: please run
rosdep update
解决方法2
raw.githubusercontent.com网站不能访问,此时可能是因为被firework墙了。
解决办法是修改hosts文件,添加这个网站的ip地址
打开hosts文件
sudo gedit /etc/hosts
在文件末尾添加
151.101.84.133 raw.githubusercontent.com
保存后退出再尝试
错误2
错误描述:
~$ sudo rosdep init
ERROR: default sources list file already exists:
/etc/ros/rosdep/sources.list.d/20-default.list
Please delete if you wish to re-initialize
解决办法:
执行以下命令,删除已经存在的初始化文件:
sudo rm /etc/ros/rosdep/sources.list.d/20-default.list
然后再重新运行
解决方法3
下载一份20-default.list,放到
/etc/ros/rosdep/sources.list.d/ 下面
运行rosdep update
这时出现部分错误 也可以继续配置完ros环境变量,运行ros。(后续再抽时间更新rosdep)
xx@ubuntu:~$ rosdep update
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
ERROR: unable to process source [https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml]:
<urlopen error ('_ssl.c:574: The handshake operation timed out',)> (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
ERROR: error loading sources list:
<urlopen error <urlopen error ('_ssl.c:574: The handshake operation timed out',)> (https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml)>
设置环境变量:
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
source ~/.bashrc
验证ros安装:
~$ roscore
... logging to /home/xx/.ros/log/8fac7312-bc6c-11eb-944c-000c29629c67/roslaunch-ubuntu-39878.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.
started roslaunch server http://ubuntu:36759/
ros_comm version 1.12.17
SUMMARY
========
PARAMETERS
* /rosdistro: kinetic
* /rosversion: 1.12.17
NODES
auto-starting new master
process[master]: started with pid [39889]
ROS_MASTER_URI=http://ubuntu:11311/
setting /run_id to 8fac7312-bc6c-11eb-944c-000c29629c67
process[rosout-1]: started with pid [39902]
started core service [/rosout]
^C[rosout-1] killing on exit
[master] killing on exit
shutting down processing monitor...
... shutting down processing monitor complete
done
rosdep update运行错误 参考链接
https://blog.csdn.net/c417469898/article/details/106360595