Ubuntu 18.04 installing ROS and summarizing the solutions of failed execution of rosdep init and rosdep update

Keywords: Ubuntu

1, Foreword

        I don't know how many times I have installed ROS. Due to learning needs, I installed ROS for the new machine again, but I was tortured by installation errors for a long time. In order to prevent the time-consuming whole network search for solutions when reinstalling, this paper is going to record the installation process and collect various solutions on the network.

2, Install ROS

1. Software source settings

① Check the source code option in 'settings -- > software and updates -- > Ubuntu software' and change the software source to domestic.   

② 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 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


3, Solution

         The problems in installing ROS basically appear in step 4 of installation.

1. Problem 1: sudo rosdep init execution error. This error is usually caused by the wall.

~$ sudo rosdep init
ERROR: cannot download default sources list from:
Website may be down.

Scheme 1: add the ip address of raw.githubusercontent.com. Don't add it according to the ip address on the Internet. It's already out of date. get into      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 add raw.githubusercontent.com at the end of the file

sudo rosdep init

Continue with the instructions in step 4 of the installation. I solved the problem according to this scheme.

Scheme 2: refer to teacher Gu Yueju

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

Scheme 3: reference users

sudo apt-get install ca-certificates
sudo rosdep init

Scheme 4: if you can't, just surf the Internet scientifically.  

2. Question 2: rosdep update   There is an error in execution. Either Hit cannot find the corresponding yaml file, or time out.

Scheme 1: refer to scheme 1 of question 1. If the normal ip address is changed, the following steps can run normally.

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

        Referring to the blogger's scheme, this scheme is more complex, but 99.9% can solve the problem. Ubuntu 18.04 experience of installing ROS and the method of 100% solving the error of rosdep update_ m0_59218577 blog - CSDN blog insert code slice herehttps://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

  4, Summary

         The whole installation tutorial is still relatively simple. I hope it can be helpful. After climbing a mountain, you will see the next peak.

5, Reference articles

Ubuntu 18.04 melody installation and download ROS (super detailed tutorial) - Gu Yueju

Ubuntu 18.04 experience of installing ROS and the method of 100% solving the error of rosdep update_ m0_59218577 blog - CSDN blog

Posted by MMeticulous on Tue, 28 Sep 2021 03:20:42 -0700