在 Ubuntu 上安装 Gazebo 8.0 时软件包损坏

在 Ubuntu 上安装 Gazebo 8.0 时软件包损坏

我正在尝试安装Gazebo 8.0 模拟器适用于 Ubuntu 16.04。我尝试了 .deb 包,它给了我这个 bash 脚本:

gazebo8_安装.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 http://packages.osrfoundation.org/gazebo/ubuntu ${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 http://packages.osrfoundation.org/gazebo.key -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."

我在终端上运行它并得到以下输出:

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.

它说我持有损坏的包裹。但命令apt-mark showhold返回空。我尝试运行 Gazebo,但它gazebo7.0没有启动8.0。这里的问题是什么?我该如何解决?

答案1

在我的设置中,libsdformat5-dev发生冲突,因为 还存在以前的版本。libignition-math3的必需包中也存在冲突libsdformat5-dev。 解决依赖项冲突后,一切都安装正常。

答案2

我已按照描述的步骤操作这里最后出现了相同的错误消息,表明存在未满足的依赖关系libsdformat5

解决这个问题的方法是先安装 libignition-math3

sudo apt-get install libignition-math3

运行该程序确实解决了依赖项冲突。之后我安装了 gazebo8:

sudo apt-get install gazebo8

而且它有效,我希望这会有所帮助。

相关内容