Solved: sudo rosdep init or rosdep update connection error solution

References: rosdep init or rosdep
update connection error solutions
sudo rosdep init error solutions


1. Problem description

The system is Ubuntu18.04. Connection errors are reported during operation rosdep initand rosdep updatetime. From the error message, it can be seen that a certain website cannot be accessed, and it should be blocked.
insert image description here

2. Solution

If the prompt is ERROR: unable to process source https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/xxxxx and other errors, and at the same time ensure that your machine can go to Baidu, this may be because The raw.githubusercontent.com website is blocked.

The solution is to modify the hosts file and add the ip address of this website.

First enter the command sudo gedit /etc/hoststo open the hosts file. You don't need to pay attention to the warning that appears after running the command, it does not affect the operation.
insert image description here
Then add the IP address and domain name of the inaccessible URL (raw.githubusercontent.com) at the end of the file.

For example 185.199.108.133 raw.githubusercontent.com.

insert image description here
Then save the file and exit the file. Then try sudo rosdep init or rosdep update again.

3. Special circumstances

Sometimes the above IPs cannot be used, here are several IP address tables found on the Internet, you can try them all.

151.101.84.133  raw.githubusercontent.com
151.101.76.133  raw.githubusercontent.com
151.101.84.133  raw.githubusercontent.com
185.199.108.133  raw.githubusercontent.com
185.199.109.133  raw.githubusercontent.com
185.199.110.133  raw.githubusercontent.com
185.199.111.133  raw.githubusercontent.com
140.82.113.4        github.com
185.199.111.153     assets-cdn.github.com
199.232.69.194      github.global.ssl.fastly.net

You can also try the following:

Through the IPAddress.com homepage or other domain name IP query website, enter raw.githubusercontent.com to query the real IP address.

insert image description here
The real IP address is as follows:
insert image description here
add it to the hosts file
insert image description here

Sometimes I use all the above IPs, but still can't connect.

Or just connect to one or a few websites successfully. It still fails.insert image description here

At this time, you can consider changing the network environment.

For example, the original home wireless download can be switched to the hotspot of your own mobile phone, or the mobile phone hotspot originally used, you can switch the provider.

After many experiments, the probability of successful connection with the mobile phone hotspot is higher.

If the problem still can't be solved, don't worry too much about it. This step does not pass and does not affect the use of ROS very much.

Guess you like

Origin blog.csdn.net/mahoon411/article/details/119610463