我无法安装软件包

我无法安装软件包

我怀疑我的软件包系统可能坏了。我尝试安装 ROS,得到了以下输出:

sudo apt-get install ros-kinetic-desktop-full
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-kinetic-desktop-full : Depends: ros-kinetic-desktop but it is not going to be installed
                            Depends: ros-kinetic-perception but it is not going to be installed
                            Depends: ros-kinetic-simulators but it is not going to be installed
                            Depends: ros-kinetic-urdf-tutorial but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

我在使用 ros 软件包时遇到了同样的问题,因此遇到了这种情况。我花了很长时间尝试单独安装该软件包的依赖项,删除冲突的软件包并安装所需的特定版本。但最终我放弃了,因为依赖项太多,并决定删除整个 ROS,然后当我尝试重新安装它时,我收到上述错误。

我已经尝试了页面修复损坏的软件包,但我无法解决问题。在 Ubuntu 16.04 中。有什么建议吗?我花了很多时间解决这个问题,我打算重新安装 Ubuntu,因为我不知道更好的解决方案。

更新

正如解释的那样我添加了答案

deb http://mirrors.ustc.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse

到 /etc/apt/sources.list 然后尝试再次安装 ros-kinetic-desktop-full,问题就解决了!不过我不太清楚为什么这样做有效。

答案1

按照ROS 维基百科。如果问题仍然存在,请删除所有索引文件并重新运行更新:

$ sudo rm -rf /var/lib/apt/lists/*
$ sudo apt-get update && sudo apt-get install --yes ros-kinetic-desktop-full

如果你查看存储库,你缺少的软件包列在包文件。所以索引肯定有问题。

相关内容