[Note-1] Ubuntu20.04系统安装ros-neotic版本时,输入 sudo rosdep init后,提示找不到命令 - 2020-10-25

  • Ubuntu20.04版本安装ros系统时碰到了与博主 "菜鸟不在家" 相同的问题,也在这里总结和记录一下。

参考链接:Ubuntu20.04系统ros-neotic版本的安装与安装过程中遇到的一些问题(纯小白教程)https://blog.csdn.net/weixin_43433726/article/details/106899359

问题:按照ROS官网的安装步骤,输入 sudo rosdep init 后,提示找不到命令。

  1. 系统版本:Ubuntu20.04
  2. ROS版本:Noetic Ninjemys
  • 要注意的是Ubuntu的版本与要安装的ros版本一定要对应(如Ubuntu20.04对应安装Noetic Ninjemys;Ubuntu18.04对应安装Melodic Morenia),具体可以百度搜索。

解决办法:

a) 首先输入:
sudo apt install python3-rosdep

注意不是 python2 ,而是 python3 。

b) 再输入:
sudo 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.

(根据博主 "菜鸟不在家" 的百度,有答主回答说是因为国内防火墙的原因, raw.githubusercontent.com 这个网站进不去,要下载的内容下载不了。)

解决办法是修改 hosts 文件。

c) 修改 hosts 文件:
  1. 打开 terminal,输入:
sudo gedit /etc/hosts
  1. 将以下内容写入hosts中:
192.30.253.118 gist.github.com
185.199.110.153 github.io

151.101.113.194 github.global.ssl.fastly.net
52.216.227.168 github-cloud.s3.amazonaws.com
52.74.223.119 github.com

199.232.28.133 avatars1.githubusercontent.com
199.232.28.133 avatars2.githubusercontent.com
199.232.28.133 avatars0.githubusercontent.com
199.232.28.133 avatars3.githubusercontent.com
199.232.28.133 raw.githubusercontent.com
199.232.28.133 user-images.githubusercontent.com
199.232.28.133 avatars.githubusercontent.com
199.232.28.133 github.map.fastly.net
199.232.28.133 avatars7.githubusercontent.com
#Amazon AWS Start
54.239.31.69 aws.amazon.com
54.239.30.25 console.aws.amazon.com
54.239.96.90 ap-northeast-1.console.aws.amazon.com
54.240.226.81 ap-southeast-1.console.aws.amazon.com
54.240.193.125 ap-southeast-2.console.aws.amazon.com
54.239.54.102 eu-central-1.console.aws.amazon.com
177.72.244.194 sa-east-1.console.aws.amazon.com
176.32.114.59 eu-west-1.console.aws.amazon.com
54.239.31.128 us-west-1.console.aws.amazon.com
54.240.254.230 us-west-2.console.aws.amazon.com
54.239.38.102 s3-console-us-standard.console.aws.amazon.com
54.231.49.3 s3.amazonaws.com
52.219.0.4 s3-ap-northeast-1.amazonaws.com
54.231.242.170 s3-ap-southeast-1.amazonaws.com
54.231.251.21 s3-ap-southeast-2.amazonaws.com
54.231.193.37 s3-eu-central-1.amazonaws.com
52.218.16.140 s3-eu-west-1.amazonaws.com
52.92.72.2 s3-sa-east-1.amazonaws.com
54.231.236.6 s3-us-west-1.amazonaws.com
54.231.168.160 s3-us-west-2.amazonaws.com
52.216.80.48 github-cloud.s3.amazonaws.com
54.231.40.3 github-com.s3.amazonaws.com
52.216.20.171 github-production-release-asset-2e65be.s3.amazonaws.com
52.216.228.168 github-production-user-asset-6210df.s3.amazonaws.com
d) 再输入:
sudo rosdep init

到这里问题得以解决,接着ROS官网(http://wiki.ros.org/noetic/Installation/Ubuntu)的安装步骤进行安装,顺利完成。

你可能感兴趣的:([Note-1] Ubuntu20.04系统安装ros-neotic版本时,输入 sudo rosdep init后,提示找不到命令 - 2020-10-25)