0

I suspect I may have a broken package system. I'm trying to install ROS and I get this output:

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.

I arrived to this situation after having the same problem with a ros package. I spent a long time trying to install the dependencies of that package individually, removing conflicting packages and installing the required specific versions. But eventually I gave up as there were too many and decided to remove the whole ROS, then when I'm trying to reinstall it I get the error above.

I have tried all the formulas explained in this page to fix broken packages, but I can't resolve the problem. In in Ubuntu 16.04. Any suggestions? I've spent a lot of time with this an I'm about to reinstall Ubuntu as I don't know a better solution.

UPDATE

As explained in this answer I added

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

to /etc/apt/sources.list then try to install ros-kinetic-desktop-full again and it solved the problem! I'm not really sure why this worked though.

martinako
  • 150

1 Answers1

2

Follow the instruction on the ROS Wiki. If the problem persist, remove all index files and re-run the update:

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

If you look at the repository, the packages you are missing, are listed in the package file. So there must be something wrong with the index.

Simon Sudler
  • 3,931
  • 3
  • 21
  • 34