Ubuntu18.04一键安装Ros2时出现404 not found
-
RUN Choose Task:[请输入括号内的数字]
请选择你要安装的ROS版本名称(请注意ROS1和ROS2区别):
[1]:bouncy(ROS2)
[2]:crystal(ROS2)
[3]:dashing(ROS2)
[4]:eloquent(ROS2)
[5]:melodic(ROS1)
[0]:quit
请输入[]内的数字以选择:3
RUN Choose Task:[请输入括号内的数字]
请选择安装的具体版本(如果不知道怎么选,请选1桌面版):
[1]:dashing(ROS2)桌面版
[2]:dashing(ROS2)基础版(小)
[0]:quit
请输入[]内的数字以选择:1
Run CMD Task:[sudo apt search aptitude ]
[-]Result:success r Debiandevelopment files)trainedRun CMD Task:[sudo apt install aptitude -y]
[-]Result:success e and 12 not upgraded.ger required:Run CMD Task:[sudo apt search aptitude ]
[-]Result:success r Debiandevelopment files)trainedRun CMD Task:[sudo apt install aptitude -y]
[-]Result:success e and 12 not upgraded.ger required:Run CMD Task:[sudo apt install ros-dashing-desktop -y]
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
efibootmgr
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
autotools-dev blt cppcheck cython default-libmysqlclient-dev fonts-lyx freeglut3 gdal-data gir1.2-harfbuzz-0.0
google-mock googletest graphviz hdf5-helpers ibverbs-providers icu-devtools libaec-dev libaec0 libann0
libarmadillo-dev libarmadillo8 libarpack2 libarpack2-dev libassimp-dev libassimp4 libavcodec-dev libavformat-dev
libavresample-dev libavresample3 libavutil-dev libblas-dev libboost-all-dev libboost-atomic-dev
libboost-atomic1.65-dev libboost-atomic1.65.1 libboost-chrono-dev libboost-chrono1.65-dev libboost-chrono1.65.1
libboost-container-dev libboost-container1.65-dev libboost-container1.65.1 libboost-context-dev
libboost-context1.65-dev libboost-context1.65.1 libboost-coroutine-dev libboost-coroutine1.65-devros-dashing-ament-index-cpp ros-dashing-ament-index-python ros-dashing-ament-lint ros-dashing-ament-lint-auto
ros-dashing-ament-lint-cmake ros-dashing-ament-lint-common ros-dashing-ament-package ros-dashing-ament-pep257
ros-dashing-ament-uncrustify ros-dashing-ament-xmllint ros-dashing-angles ros-dashing-builtin-interfacesErr:1 https://repo.huaweicloud.com/ros2/ubuntu bionic/main amd64 ros-dashing-ros-workspace amd64 0.7.2-1bionic.20201125.033634
404 Not Found [IP: 218.10.185.36 443]
Err:2 https://repo.huaweicloud.com/ros2/ubuntu bionic/main amd64 ros-dashing-fastcdr amd64 1.0.13-1bionic.20201125.034826
。。。
[]Err:226 https://repo.huaweicloud.com/ros2/ubuntu bionic/main amd64 ros-dashing-desktop amd64 0.7.4-1bionic.20210521.2[-]Result:code:100Run CMD Task:[ls /opt/ros/dashing/setup.bash]
[-]Result:code:2安装失败了,请打开鱼香社区:https://fishros.org.cn/forum 在一键安装专区反馈问题...
Run CMD Task:[ls /opt/ros/dashing/setup.bash]
[-]Result:code:2 -
在您的Ubuntu 18.04系统上安装ROS 2时遇到的
404 Not Found
错误表明指定的软件包在配置的仓库中不存在或已被移除。这通常是因为您尝试安装的ROS 2版本(在这个例子中是Dashing)已经不再被官方维护或更新,或者您使用的镜像源(在这个案例中是华为云的ROS 2仓库)中不包含该版本的包。为了解决这个问题,您可以尝试以下几个步骤:
-
更换ROS 2版本:
- 考虑到Dashing版本可能已经不再被支持,您可以尝试安装一个更新的ROS 2版本,如Eloquent或Foxy。这些版本通常会在官方源中找到,并且更有可能得到社区的广泛支持。
-
更换软件源:
- 如果您想坚持使用Dashing版本,尝试更换到一个包含该版本包的ROS 2源。例如,您可以使用官方的ROS 2仓库而不是华为云的。
-
手动安装:
- 如果以上方法都不可行,您可能需要考虑从源代码手动编译ROS 2。这通常更复杂,但允许您安装任何版本的ROS 2,只要您能找到其源代码。
更换ROS 2版本安装步骤
这里是一个简化的安装ROS 2 Foxy版本的步骤(以Ubuntu 18.04为例):
-
设置ROS 2仓库:
sudo apt update && sudo apt install -y curl wget sudo sh -c 'echo "deb [arch=amd64,arm64] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros2-latest.list' sudo apt install -y software-properties-common sudo add-apt-repository universe sudo apt update
-
安装ROS 2:
sudo apt install -y ros-foxy-desktop sudo apt install -y python3-rosdep python3-rosinstall python3-vcstools sudo rosdep init rosdep update rosdep install --from-paths src --ignore-src -r -y
-
环境设置:
echo "source /opt/ros/foxy/setup.bash" >> ~/.bashrc source ~/.bashrc
-
验证安装:
ros2 run demo_nodes_cpp talker
在另一个终端中:
ros2 run demo_nodes_py listener
确保在执行这些步骤时替换为您想要安装的ROS 2版本(如Foxy、Eloquent等)。如果您选择从源代码编译,那么过程将更加复杂,需要克隆ROS 2的仓库,并遵循其文档中的构建说明。
以上为生成回答,仅供参考~
-