ubuntu16安装ROS(包括win10子系统ubuntu同样能用)

1.  sudo sh -c ‘echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list‘

2. sudo apt-key adv --keyserver ‘hkp://keyserver.ubuntu.com:80‘ --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654

3.sudo apt-get update

4.sudo rosdep init
执行这一步后会基本都会出现website may be down

尝试过很多网上其他人的博客方法后,找到的能用的解决办法:参考链接:http://www.bubuko.com/infodetail-3520310.html

主要如下:

  1. Windows打开C:/windows/system32/drivers/etc/hosts,追加下面内容后刷新DNS缓存ipconfig /flushdns
  2. Linux打开/etc/hosts,追加下面内容,无需刷新缓存
  3. Mac打开/etc/hosts,追加下面内容,使用sudo killall -HUP mDNSResponder刷新DNS缓存
    # GitHub Start
    52.74.223.119     github.com
    192.30.253.119    gist.github.com
    54.169.195.247    api.github.com
    185.199.111.153   assets-cdn.github.com
    151.101.76.133    raw.githubusercontent.com
    151.101.76.133    gist.githubusercontent.com
    151.101.76.133    cloud.githubusercontent.com
    151.101.76.133    camo.githubusercontent.com
    151.101.76.133    avatars0.githubusercontent.com
    151.101.76.133    avatars1.githubusercontent.com
    151.101.76.133    avatars2.githubusercontent.com
    151.101.76.133    avatars3.githubusercontent.com
    151.101.76.133    avatars4.githubusercontent.com
    151.101.76.133    avatars5.githubusercontent.com
    151.101.76.133    avatars6.githubusercontent.com
    151.101.76.133    avatars7.githubusercontent.com
    151.101.76.133    avatars8.githubusercontent.com
    # GitHub End
5.rosdep update这一步执行后会出现time out解决办法,有些用自己手机开个热点就可以了,手机热点也不行的话把downLoad_timeout延长就行。命令如下:sudo vim /usr/lib/python2.7/dist-packages/rosdep2/gbpdistro_support.py在比较靠前的位置有这个downLoad_timeout = 15.0.我把它改到500后再次执行,一次就成功了。6. echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc7. source ~/.bashrc8. sudo apt-get install python-rosinstall python-rosinstall-generator python-wstool build-essential9. Roscore10.结束

相关推荐