安装 ROS2:E:无法纠正问题,您持有损坏的软件包

安装 ROS2:E:无法纠正问题,您持有损坏的软件包

我不是 Linux 专家,只是 ROS 的初学者。我需要安装此版本的 ros:ROS 2 Foxy Fitzroy (https://docs.ros.org/en/foxy/Installation.html

在我的Linux计算机上:

Distributor ID: Ubuntu
Description:    Ubuntu 20.04.3 LTS
Release:    20.04
Codename:   focal

我在使用该命令时遇到了一些问题:sudo apt install ros-foxy-desktop 出现此错误:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 ros-foxy-desktop : Depends: ros-foxy-action-tutorials-cpp but it is not going to be installed
                    Depends: ros-foxy-action-tutorials-interfaces but it is not going to be installed
                    Depends: ros-foxy-action-tutorials-py but it is not going to be installed
                    Depends: ros-foxy-composition but it is not going to be installed
                    Depends: ros-foxy-demo-nodes-cpp but it is not going to be installed
                    Depends: ros-foxy-demo-nodes-cpp-native but it is not going to be 
                    Depends: ros-foxy-examples-rclcpp-minimal-client but it is not going to be installed
                    Depends: ros-foxy-examples-rclcpp-minimal-composition but it is not going to be installed
                    Depends: ros-foxy-examples-rclcpp-minimal-publisher but it is not going to be installed
                    Depends: ros-foxy-examples-rclcpp-minimal-service but it is not going to be installed
                    Depends: ros-foxy-examples-rclcpp-minimal-subscriber but it is not going to be installed
                    Depends: ros-foxy-examples-rclcpp-minimal-timer but it is not going to be installed
                    Depends: ros-foxy-tlsf-cpp but it is not going to be installed
                    Depends: ros-foxy-topic-monitor but it is not going to be installed
                    Depends: ros-foxy-turtlesim but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

我已经尝试了两天寻找解决方案,但毫无线索。

以下是我尝试过的一些命令及其结果:

sudo apt-get update --fix-missing && sudo apt-get upgrade && sudo apt-get dist-upgrade

Hit:1 http://archive.canonical.com/ubuntu bionic InRelease
Hit:2 http://archive.ubuntu.com/ubuntu bionic InRelease                                                             
Get:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]                                           
Hit:4 http://ppa.launchpad.net/git-core/ppa/ubuntu focal InRelease                                                  
Hit:5 http://dl.google.com/linux/chrome/deb stable InRelease                                                        
Hit:6 http://packages.microsoft.com/repos/code stable InRelease                                                     
Get:7 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]                                         
Get:8 http://archive.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]                                          
Hit:9 http://archive.ubuntu.com/ubuntu focal InRelease                                                              
Ign:10 http://linux.dropbox.com/ubuntu disco InRelease                              
Hit:11 http://linux.dropbox.com/ubuntu disco Release     
Hit:12 http://packages.ros.org/ros2/ubuntu focal InRelease
Fetched 252 kB in 3s (89.0 kB/s)                          
Reading package lists... Done
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

sudo dpkg --configure -a 沒有顯示任何内容

dpkg --get-selections | grep hold 沒有顯示任何内容

如果您有任何建议我很乐意尝试。

感谢所有花时间阅读我的消息的人!

相关内容