I am trying to install Gazebo 8.0 simulator for Ubuntu 16.04. I tried the .deb package which gave me this bash script :
gazebo8_install.sh :
# Description:
# This script installs gazebo onto an Ubuntu system.
codename=`lsb_release -sc`
# Make sure we are running a valid Ubuntu distribution
case $codename in "xenial" | "yakkety" ) ;; *) echo "This script will only work on Ubuntu xenial, and yakkety" exit 0
esac
# Add the OSRF repository
if [ ! -e /etc/apt/sources.list.d/gazebo-latest.list ]; then sudo sh -c "echo \"deb ${codename} main\" > /etc/apt/sources.list.d/gazebo-latest.list"
fi
# Download the OSRF keys
has_key=`apt-key list | grep "OSRF deb-builder"`
echo "Downloading keys"
if [ -z "$has_key" ]; then wget --quiet -O - | sudo apt-key add -
fi
# Update apt
echo "Retrieving packages"
sudo apt-get update -qq
echo "OK"
# Install gazebo
echo "Installing Gazebo"
sudo apt-get install gazebo8 libgazebo8-dev
echo "Complete."
echo "Type gazebo to start the simulator."I ran it on Terminal with this output :
Downloading keys
OK
Retrieving packages
OK
Installing Gazebo
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: gazebo8 : Depends: libgazebo8 (= 8.0.0-1~xenial) but it is not going to be installed Depends: libsdformat5 but it is not going to be installed Recommends: gazebo8-plugin-base libgazebo8-dev : Depends: libsdformat5-dev but it is not going to be installed Depends: libignition-math3-dev (> 3.0.0-1) but it is not going to be installed Depends: libignition-transport3-dev (> 3.0.1-1) but it is not going to be installed Depends: libignition-msgs-dev (>= 0.6.999) but it is not going to be installed Depends: libgazebo8 (= 8.0.0-1~xenial) but it is not going to be installed Depends: gazebo8-plugin-base (= 8.0.0-1~xenial)
E: Unable to correct problems, you have held broken packages.
Complete.
Type gazebo to start the simulator.It says I have held broken packages. But the command apt-mark showhold returns empty. I tried to run Gazebo but it starts gazebo7.0 not 8.0. What is the problem here & how do I solve it?
2 Answers
In my setup, the libsdformat5-dev had a conflict because a previous version had also been present. There was also conflict in libignition-math3 package that was meant as requirement for libsdformat5-dev. After resolving the conflicts in dependencies, everything got installed alright.
I had followed the steps described here and ended up with the same error messages indicating that there were unmet dependencies with libsdformat5
What solved it was installing libignition-math3 first
sudo apt-get install libignition-math3Running that did resolve the dependencies conflicts. After that I install gazebo8:
sudo apt-get install gazebo8And it worked, I hope this helps.