The default software source of ros is foreign, and ros is very slow when installing software. You can consider changing to a domestic source.
Open the website: http://wiki.ros.org/ROS/Installation/UbuntuMirrors to
find China, use the source of the University of Science and Technology of China or Tsinghua University, the speed is very fast:
sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.ustc.edu.cn/ros/ubuntu/ `lsb_release -cs` main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-get update
After performing the above operations, the software installation speed is very fast.