0
$\begingroup$

Rosanswers logo

Hello,

I am trying to install ROS Melodic on a quite fresh (1 week old) Ubuntu 18.04 installation, but have run into a problem with unmet dependencies when following the instructions at http://wiki.ros.org/melodic/Installation/Ubuntu.

The error appears after the command:

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

I tried following the dependency tree but after getting 4 levels of dependency in (dependency's dependency and so on) I got the feeling that this is not the right way to install ROS, as it should work just with the steps outlined in the installation instructions.

As per the installation instructions I have:

  • Allowed Ubuntu software to install from "restricted", "universe" and "multiverse

  • configured my sources.list:

    alex@alex-XPS-15-9530:~$ cat /etc/apt/sources.list.d/ros-latest.list deb http://packages.ros.org/ros/ubuntu bionic main

  • Set up the keys

  • Updated my package index and also ran apt upgrade and dist-upgrade

I have checked these two posts with a seemingly similar issue on the forum:

https://answers.ros.org/question/299260/unmet-dependencies-when-installing-melodic-on-ubuntu-1804/

  • The OP didn't indicate whether it was resolved, but another person said that they solved the problem by removing previously installed ROS and Gazebo software. I haven't installed anything ROS related on this computer yet.

https://answers.ros.org/question/306742/install-ros-melodic-on-ubuntu-18-bionic-unmet-dependencies-unable-to-locate-package/

  • This was solved by using aptitude instead of apt. I tried this but aptitude's solution seemed to leave out a lot of ros-melodic packages and after running it I still had no ROS installed.

I also found this: https://askubuntu.com/questions/1041981/stuck-in-infinite-loop-of-unmet-dependencies-due-to-broken-packages - I don't know how the OP figured out that libusb was causing the problem. I don't have enough "reputation" to comment on that thread to ask how they did it! Does anyone know how to investigate that?

Now I'm a bit stuck! Does anyone have any ideas?

Any help is much appreciated.

Alex

EDIT

Output of sudo apt-get install ros-melodic-urdf-sim-tutorial:

alex@alex-XPS-15-9530:~$ sudo apt-get install ros-melodic-urdf-sim-tutorial
[sudo] password for alex: 
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-melodic-urdf-sim-tutorial : Depends: ros-melodic-controller-manager but it is not going to be installed
                                 Depends: ros-melodic-diff-drive-controller but it is not going to be installed
                                 Depends: ros-melodic-gazebo-ros but it is not going to be installed
                                 Depends: ros-melodic-gazebo-ros-control but it is not going to be installed
                                 Depends: ros-melodic-joint-state-controller but it is not going to be installed
                                 Depends: ros-melodic-position-controllers but it is not going to be installed
                                 Depends: ros-melodic-robot-state-publisher but it is not going to be installed
                                 Depends: ros-melodic-rqt-robot-steering but it is not going to be installed
                                 Depends: ros-melodic-rviz but it is not going to be installed
                                 Depends: ros-melodic-urdf-tutorial but it is not going to be installed
                                 Depends: ros-melodic-xacro but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

To take it further, if I try to install ros-melodic-xacro I find that that package as an unmet dependency on ros-melodic-roslaunch, which then has further unmet dependencies.

EDIT 2

Synaptic searching for broken packages: I don't have enough points (being new to the forum) to post a screenshot, but I opened Synaptic Package Manager, searched using the custom filter "Broken" and got the following output: 0 packages listed, 1852 installed, 0 broken, 0 to install/upgrade, 0 to remove

Output when trying to install ros-melodic-gazebo-ros

alex@alex-XPS-15-9530:~$ sudo apt-get install ros-melodic-gazebo-ros
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-melodic-gazebo-ros : Depends: libgazebo9 but it is not going to be installed
                          Depends: ros-melodic-dynamic-reconfigure but it is not going to be installed
                          Depends: ros-melodic-gazebo-dev but it is not going to be installed
                          Depends: ros-melodic-gazebo-msgs but it is not going to be installed
                          Depends: ros-melodic-geometry-msgs but it is not going to be installed
                          Depends: ros-melodic-roscpp but it is not going to be installed
                          Depends: ros-melodic-rosgraph-msgs but it is not going to be installed
                          Depends: ros-melodic-roslib but it is not going to be installed
                          Depends: ros-melodic-std-msgs but it is not going to be installed
                          Depends: ros-melodic-std-srvs but it is not going to be installed
                          Depends: ros-melodic-tf but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

As for any interesting software I might have installed since I installed this Ubuntu fresh a week ago - I don't think so. I believe this should show all my sources (I removed #commented lines for brevity):

alex@alex-XPS-15-9530:~$ grep ^ /etc/apt/sources.list /etc/apt/sources.list.d/*
/etc/apt/sources.list:deb-src http://archive.ubuntu.com/ubuntu bionic main restricted #Added by software-properties
/etc/apt/sources.list:deb http://gb.archive.ubuntu.com/ubuntu/ bionic main restricted
/etc/apt/sources.list:deb-src http://gb.archive.ubuntu.com/ubuntu/ bionic multiverse universe restricted main
/etc/apt/sources.list:deb http://gb.archive.ubuntu.com/ubuntu/ bionic universe
/etc/apt/sources.list:deb http://gb.archive.ubuntu.com/ubuntu/ bionic multiverse
/etc/apt/sources.list:deb http://gb.archive.ubuntu.com/ubuntu/ bionic-security main restricted
/etc/apt/sources.list:deb-src http://gb.archive.ubuntu.com/ubuntu/ bionic-security multiverse universe restricted main #Added by software-properties
/etc/apt/sources.list:deb http://gb.archive.ubuntu.com/ubuntu/ bionic-security universe
/etc/apt/sources.list:deb http://gb.archive.ubuntu.com/ubuntalex@alex-XPS-15-9530:~$ sudo apt-get install ros-melodic-abseil-cpp

Reading package lists... Done Building dependency tree
Reading state information... Done The following NEW packages will be installed ros-melodic-abseil-cpp 0 to upgrade, 1 to newly install, 0 to remove and 0 not to upgrade. Need to get 314 kB of archives. After this operation, 1,550 kB of additional disk space will be used. Get:1 http://packages.ros.org/ros/ubuntu bionic/main amd64 ros-melodic-abseil-cpp amd64 0.2.3-1bionic.20180719.150528 [314 kB] Fetched 314 kB in 2s (171 kB/s)
Selecting previously unselected package ros-melodic-abseil-cpp. (Reading database ... 197331 files and directories currently installed.) Preparing to unpack .../ros-melodic-abseil-cpp_0.2.3-1bionic.20180719.150528_amd64.deb ... Unpacking ros-melodic-abseil-cpp (0.2.3-1bionic.20180719.150528) ... Setting up ros-melodic-abseil-cpp (0.2.3-1bionic.20180719.150528) ... alex@alex-XPS-15-9530:~$ apt list --installed ros Listing... Done alex@alex-XPS-15-9530:~$ apt list --installed ros* Listing... Done ros-melodic-abseil-cpp/bionic,now 0.2.3-1bionic.20180719.150528 amd64 [installed]u/ bionic-security multiverse /etc/apt/sources.list.d/ros-latest.list:deb http://packages.ros.org/ros/ubuntu bionic main

EDIT 3

I tried to follow the gazebo package:

alex@alex-XPS-15-9530:~$ sudo apt-get install ros-melodic-gazebo-dev
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-melodic-gazebo-dev : Depends: gazebo9
                          Depends: libgazebo9-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
alex@alex-XPS-15-9530:~$ sudo apt-get install gazebo9
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.
 gazebo9 : Depends: libgazebo9 (= 9.0.0+dfsg5-3ubuntu1+ppa2) but it is not going to be installed
           Recommends: gazebo9-plugin-base
E: Unable to correct problems, you have held broken packages.
alex@alex-XPS-15-9530:~$ sudo apt-get install libgazebo9
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.
 libgazebo9 : Depends: gdal-abi-2-2-3
              Depends: libgdal20 (>= 2.0.1) but it is not going to be installed
              Depends: libsimbody3.5v5 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
alex@alex-XPS-15-9530:~$ sudo apt-get install gdal-abi-2-2-3
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'libgdal20' instead of 'gdal-abi-2-2-3'
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.
 libgdal20 : Depends: libarmadillo8 but it is not going to be installed
             Depends: libhdf5-100 but it is not going to be installed
             Depends: libnetcdf13 (>= 4.0.1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

EDIT 4

I just remembered I did install the C++ boost library - specifically boost1.69.0 from here: https://sourceforge.net/projects/boost/files/boost/1.69.0/

I have some older (v1.65.1) elements of libboost installed too, apparently:

alex@alex-XPS-15-9530:~$ apt list --installed libboost*
Listing... Done
libboost-date-time1.65.1/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed]
libboost-filesystem1.65.1/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed]
libboost-iostreams1.65.1/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed]
libboost-locale1.65.1/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed]
libboost-system1.65.1/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed]
libboost-thread1.65.1/bionic,now 1.65.1+dfsg-0ubuntu5 amd64 [installed]

I wonder if this is interfering with the ROS installation procedure?

EDIT 5

To install libboost, I downloaded the boost_1_69_0.tar.gz archive from https://www.boost.org/users/download/ (erroneously said it was from sourceforge in edit 4) and ran the bootstrap and bjam scripts to install.

Output of sudo apt install ros-melodic-ros-base:

alex@alex-XPS-15-9530:~$ sudo apt install ros-melodic-ros-base
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-melodic-ros-base : Depends: ros-melodic-actionlib but it is not going to be installed
                        Depends: ros-melodic-bond-core but it is not going to be installed
                        Depends: ros-melodic-dynamic-reconfigure but it is not going to be installed
                        Depends: ros-melodic-nodelet-core but it is not going to be installed
                        Depends: ros-melodic-ros-core but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

EDIT 6

Choosing the first ROS package by alphabetical order, I am able to install at least a ROS package:

alex@alex-XPS-15-9530:~$ sudo apt-get install ros-melodic-abseil-cpp
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed
  ros-melodic-abseil-cpp
0 to upgrade, 1 to newly install, 0 to remove and 0 not to upgrade.
Need to get 314 kB of archives.
After this operation, 1,550 kB of additional disk space will be used.
Get:1 http://packages.ros.org/ros/ubuntu bionic/main amd64 ros-melodic-abseil-cpp amd64 0.2.3-1bionic.20180719.150528 [314 kB]
Fetched 314 kB in 2s (171 kB/s)                 
Selecting previously unselected package ros-melodic-abseil-cpp.
(Reading database ... 197331 files and directories currently installed.)
Preparing to unpack .../ros-melodic-abseil-cpp_0.2.3-1bionic.20180719.150528_amd64.deb ...
Unpacking ros-melodic-abseil-cpp (0.2.3-1bionic.20180719.150528) ...
Setting up ros-melodic-abseil-cpp (0.2.3-1bionic.20180719.150528) ...
alex@alex-XPS-15-9530:~$ apt list --installed ros*
Listing... Done
ros-melodic-abseil-cpp/bionic,now 0.2.3-1bionic.20180719.150528 amd64 [installed]

However ros-melodic-roscpp-core failed with more unmet dependencies.

EDIT 7

To check that the problem is with my Ubuntu installation, I installed an Ubuntu 18.04.2 virtual machine with VirtualBox, and was able to install ros-melodic-desktop-full following the standard ROS instructions. Therefore, I used this script (https://github.com/lepe/scripts/blob/master/compare_ubuntu_apt.pl) to compare installed packages between my ubuntu installation and the virtual machine. The command I used on each Ubuntu to generate the list of installed packages was apt --installed list | tail -n+2 > that_server.lst. I would upload the result as a file to this question but I don't have enough points, so here it is:

This code block was moved to the following github gist: https://gist.github.com/answers-se-migration-openrobotics/e069ee6dc42b96c40e4dafc8f3f94c65


Originally posted by alex97 on ROS Answers with karma: 1 on 2019-02-16

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

  • Reason

    Some dependencies are not installed, and the previously installed versions of the dependencies are not correct, some require downgrade, and some require upgrade

  • Install environment

Use the original sources.list: dep http://ports.ubuntu.com/bionic main res...

Other sources.list: ustc, tuna... have not been tested

  • Solution

  • Install aptitude

         sudo apt-get install aptitude
    

2.Install ros-melodic-desktop-full with aptitude

    sudo aptitude install ros-melodic-desktop-full

3.The first prompt reminds us that there are a lot of things that are not installed, about 100-600, let us choose to keep the original ones, but there is no at all, enter n here

4.The second prompt may ask us to upgrade or downgrade something, this is what we need, choose Y

5.Select Y to install

6.After that, “-O APT:::GET::Fix-Missing=true” may appear, execute: sudo apt-get --fix-missing

7.Repeat a few times from step 1-6, each time you will find that things you need to install will be reduced a lot, and finally, if you have no problem after step 6, it will automatically install ros.

  • It works for me

Originally posted by arahp with karma: 46 on 2020-06-21

This answer was ACCEPTED on the original site

Post score: 3


Original comments

Comment by Yury Rumyantsev on 2020-08-31:
I had the same problem installing ros-melodic-desktop-full on fresh Ubuntu 18.04.

Using aptitude saved my day

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.