Ubuntu18.04 installs ROS and summarizes the solution to the execution failure of rosdep init and rosdep update

I. Introduction

        I have installed ROS for an unknown number of times. Due to learning needs, I installed ROS on the new machine again, and I was tortured by installation errors for a long time. In order to prevent the time-consuming search for solutions on the whole network when reinstalling, this article is going to record the installation process and collect various solutions on the Internet.

2. Install ROS

1. Software source setting

① Check the source code option in 'Settings-->Software and Update-->Ubuntu Software' , and replace the software source with domestic ones.  

② Add ROS software source

sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu/ $DISTRIB_CODENAME main" > /etc/apt/sources.list.d/ros-latest.list'

 2. Set the public key

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

3. Install ROS

sudo apt-get update
sudo apt-get install ros-melodic-desktop-full
sudo apt-get install ros-melodic-rqt*
sudo apt-get install python-rosdep

4. Initialize ROS

sudo rosdep init
rosdep update

5. Test ROS

roscore

3. Solutions

        The problems with installing ROS basically appear in the fourth step of the installation.

1. Question 1: There is an error in the execution of sudo rosdep init. This error is generally blocked by the wall.

~$ 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.

Solution 1: Add the ip address of raw.githubusercontent.com. Don't just add it according to the ip given on the Internet here, it has long been outdated. Enter     The Best IP Address, Email and Networking Tools - IPAddress.com    , enter raw.githubusercontent.com in the search box and search to get the IP address.

 

 

 add ip

sudo gedit /etc/hosts

#e.g  在文件末尾添加     185.199.108.133  raw.githubusercontent.com

sudo rosdep init

Proceed to the instructions in step 4 of the installation. I solved the problem according to this solution.

Solution 2: Refer to Teacher Gu Yueju

sudo c_rehash /etc/ssl/certs
sudo -E rosdep init

Option 3: Refer to Netizens

sudo apt-get install ca-certificates
sudo rosdep init

Solution 4: Go online scientifically if it doesn’t work. 

2. Question 2: rosdep update is executed incorrectly, either it fails to hit the corresponding yaml file, or it times out.

Solution 1: Refer to Solution 1 of Question 1. The normal ip address is changed, and the following steps can run normally.

Solution 2: Download and save the corresponding yaml file locally.

        Refer to the blogger's solution, which is more complicated, but 99.9% can solve the problem. The experience of installing ROS on ubuntu18.04, 100% solution to rosdep update error report_m0_59218577's blog-CSDN blog Insert code slice here https://blog.csdn.net/m0_59218577/article/details/118344779?utm_medium=distribute .pc_relevant_t0.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-1.no_search_link&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-1.no_search_link

 Four. Summary

        The whole installation tutorial is relatively simple, I hope it can help. Over a mountain is another mountain, see you on the next mountain.

5. Reference Articles

Ubuntu18.04 melodic installation and download ROS (super detailed tutorial) - Gu Yueju

The experience of installing ROS on ubuntu18.04, a 100% solution to the error reported by rosdep update_m0_59218577's blog-CSDN Blog

Guess you like

Origin blog.csdn.net/qq_40691868/article/details/120532923