Ask Your Question

Unmet dependencies when installing Melodic on Ubuntu 18.04

asked 2018-08-01 02:26:32 -0600

apache8080 gravatar image

updated 2018-08-01 10:35:57 -0600

When running: sudo apt install ros-melodic-desktop-full

I get the following error:

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 have followed the instructions here:

I am running Ubuntu 18.04

edit retag flag offensive close merge delete


Do you have Gazebo installed from the osrf repositories by any chance?

When running: sudo rm /var/cache/apt/archives/lock

don't you mean "after running .."? That command only deletes a file, it does not ask apt to install any packages.

gvdhoorn gravatar image gvdhoorn  ( 2018-08-01 04:49:17 -0600 )edit

I accidentally put the wrong command in my question. I have now updated it.

apache8080 gravatar image apache8080  ( 2018-08-01 10:36:29 -0600 )edit

But did you install Gazebo sometime earlier and from the OSRF repositories?

gvdhoorn gravatar image gvdhoorn  ( 2018-08-02 02:53:25 -0600 )edit

Use aptitude as explained here. It guides you through fixing dependencies.

dslowik gravatar image dslowik  ( 2019-10-27 14:40:16 -0600 )edit

3 Answers

Sort by ยป oldest newest most voted

answered 2018-08-18 23:51:32 -0600

Catherine Wong gravatar image

I had the same problem. For me, I ran sudo apt-get install ros-desktop-full before I realized that is not Melodic. I removed that afterwards but I had the same error when I tried to install with sudo apt-get install ros-melodic-desktop-full.

I think the error came from the fact that I had rospkg 1.1.4 instead of 1.1.7 when I installed ros_desktop_full. I did

sudo apt-get remove gazebo9* catkin python-rospkg python-rospkg-modules

(Here, I also removed gazebo9 related packages and catkin that were installed with ros-desktop-full.) Afterwards, I tried to install the melodic desktop full version again and it worked for me.

edit flag offensive delete link more


Just for reference: you probably ran into UpstreamPackages.

gvdhoorn gravatar image gvdhoorn  ( 2018-08-19 02:27:07 -0600 )edit

Same happened to me, accidentally first installed ros-desktop-full. Your command worked for me :)

sonjabrits gravatar image sonjabrits  ( 2020-04-21 07:29:42 -0600 )edit

answered 2020-05-05 02:53:44 -0600

Neeraj Patil gravatar image

I had encountered the same error. I overcome doing the following steps:-

1.This command will remove gazebo9 ,catkin , python-rospkg , python-rospkg-modules packages from your system

sudo apt-get remove gazebo9* catkin python-rospkg python-rospkg-modules

2.This command will remove packages from your system, for example, to remove ros related files:

sudo apt-get remove ros-*

3.This command will remove packages and their configuration files.

sudo apt-get purge ros-*

4.sudo apt-get remove ros-melodic-desktop-full

5.sudo apt-get purge ros-melodic-desktop-full

6.This command will remove dependencies that are no longer needed.

sudo apt-get autoremove

7.sudo apt-get install -f

8.sudo apt-get update

9.sudo apt-get upgrade

10.Now install ros-melodic-desktop-full

sudo apt install ros-melodic-desktop-full

References:link text

edit flag offensive delete link more

answered 2019-02-08 04:58:37 -0600

Configure your Ubuntu repositories properly and try further.

Configure your Ubuntu repositories to allow "restricted," "universe," and "multiverse." You can follow the Ubuntu guide for instructions on doing this.

If not you can look into earlier python versions and dependencies.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2018-08-01 02:26:32 -0600

Seen: 7,331 times

Last updated: Aug 18 '18