I changed the version of ubuntu to 20.04, so I reinstalled ros.
First of all, the ros-melodic I used before doesn't seem to work with 20.04LTS 20.04 LTS announced a new version called noetic, so I installed it
It seemed that melodic-related dependencies were in the way, so I deleted all ros-related ones.
sudo apt-get remove ros-*
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
This should be straightforward (I didn't know later)
First add noetic repo.
echo "deb http://packages.ros.org/ros/ubuntu focal main" | sudo tee /etc/apt/sources.list.d/ros-focal.list
Then somehow register the key
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
Do it as usual
sudo apt update
sudo apt install ros-noetic-desktop-full
I usually made it desktop-full. There seem to be many other things. Reference article https://varhowto.com/install-ros-noetic-ubuntu-20-04/
This was also a swamp
sudo apt-get install python3-rosdep python3-rosinstall-generator python3-vcstool build-essential
sudo rosdep init
At this point, I had to erase the previously remaining rosdep. Reference article http://wiki.ros.org/noetic/Installation/Source
I didn't write it anywhere ...
sudo apt-get install python3-rosinstall
$ mkdir ~/ros_catkin_ws
$ cd ~/ros_catkin_ws
$ rosinstall_generator desktop --rosdistro noetic --deps --tar > noetic-desktop.rosinstall
$ mkdir ./src
$ vcs import --input noetic-desktop.rosinstall ./src
$ rosdep install --from-paths ./src --ignore-packages-from-source --rosdistro noetic -y
$ ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release
The last one took a tremendous amount of time. I'm worried because it's quite different from melodic.