Command not found E: Unable to obtain the lock, rosdep init initialization failure problem (all methods on the Internet can not be solved, it is not a network problem, I will teach you to install) ↵
Install Melodic
When a novice installs melodic for the first time, the installation process always encounters an error report according to the installation steps. Your running results are not as good as those of their bloggers. You can find many blog results that are the same (you ca n’t solve the problem at all, wasting time and energy) The problem of initialization failure is not at network speed! It's because GitHub is blocked.
apt install -y ros-melodic-desktop-full,
Initialize sudo rosdep init
Error:
ERROR:cannot download default sources list from
https://raw.githubuser content.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.lis
1 Configure ROS software source
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
2 configuration key
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
3 Update system software source
sudo apt update
4 Install Melodic (the first pit !!!)
sudo apt install ros-melodic-desktop-full
E: Unable to obtain lock execution failure (solution given below)
Execute in turn
sudo ps -ef | grep dpkg | awk -F ' ' '{print $2}' | xargs sudo kill -9
sudo ps -ef | grep apt | awk -F ' ' '{print $2}' | xargs sudo kill -9
sudo rm -rf /var/lib/dpkg/lock-frontend
sudo rm -rf /var/lib/dpkg/lock
sudo rm -rf /var/lib/dpkg/lock*
2 Restart, restart as many times as possible, it will be more than a few times, and then you can
5 Initialization (second pit !!!)
sudo rosdep init
rosdep update
There will be this initialization error. None of the three methods on the initialization error network can solve the problem. Some people say that the network is not good, and some people say that it is a hot spot. When you copy the above page, you ca n’t open the connection, so you create the folder. It's useless, because the problem is not the speed of the network! ! ! Because it blocked github
Start to solve the initialization problem below
1 Enter the authority to simplify subsequent instructions.
进入root权限
sudo su
2Execute the following statement, it will display
lsb_release -a
3 implementation
apt install -y ros-melodic-desktop-full
4 Solve the GitHub shielding problem
carried out
sed -i "s/raw.githubusercontent.com/raw.ctl.app/g" /usr/lib/python2.7/dist-packages/rosdistro/__init__.py
sed -i "s/raw.githubusercontent.com/raw.ctl.app/g" /usr/lib/python2.7/dist-packages/rosdistro/manifest_provider/github.py
sed -i "s/raw.githubusercontent.com/raw.ctl.app/g" /usr/lib/python2.7/dist-packages/rosdep2/rep3.py
sed -i "s/raw.githubusercontent.com/raw.ctl.app/g" /usr/lib/python2.7/dist-packages/rosdep2/gbpdistro_support.py
5rosdep init
6 Execute the following instructions in sequence
7 start rosdep
8 configuration environment variables
The installation is complete!
Check below
roscore
rosrun turtlesim turtlesim_node
rosrun turtlesim turtle_teleop_key
Execute the above 3 commands in turn on 3 terminals to
control the little turtle, click the last terminal and don't click on other positions, you can use the keyboard arrow keys to control