Article directory
1.Configure Software & Updates
- Just configure it as shown in the picture
2. Add software source
- If you do not add the software source, you cannot locate the software package.
Tsinghuayuan
sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu/ `lsb_release -cs` main" > /etc/apt/sources.list.d/ros-latest.list'
3.Set key
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
- If you do not set the key, you will have the following problems when sudo apt update
4. Update and install
4.1 Update
sudo apt update
4.2 Installation (ros-noetic-desktop-full)
- If you use apt to install, almost 100% of the time the following problems will occur
- So we use aptitude to install
4.2.1 Install aptitude
sudo apt install aptitude
4.2.2 Install ROS software package
sudo aptitude install ros-noetic-desktop-full
- Next, a column of uninstalled items will be listed, as shown below.
- Remember, you must choose no at this time
- Then, aptitude will give the second solution. There are still many uninstalled ones. Continue to select no.
- For the third time, aptitude gave a satisfactory solution, but only one was not installed. At this time, you can choose yes.
5. Add environment variables
echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
6. Install build dependencies
sudo apt install python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential
7.Initialization and update
7.1 Initialization
sudo rosdep init
- Since overseas resources are blocked, initialization will almost 100% fail.
7.1.1 Currently feasible solution: Relocate resources
- Modify line 68 of /usr/lib/python3/dist-packages/rosdistro/__init__.py
- Modify line 64 of /usr/lib/python3/dist-packages/rosdep2/sources_list.py
- Modify line 36 of /usr/lib/python3/dist-packages/rosdep2/rep3
- Modification method:
raw.githubusercontent.com/ros/rosdistro/master
Replace withgitee.com/zhao-xuzuo/rosdistro/raw/master
, as shown below
7.1.2 Results
sudo rosdep init
- It is successful if the following result occurs
7.2 Update
rosdep update
- result