安装 libgl1-mesa-dev 时的依赖版本问题

安装 libgl1-mesa-dev 时的依赖版本问题

我有点新手,坦白地承认我不知道自己在做什么。我正在尝试安装 OpenGL 的开发包。我过去曾使用 apt-get 安装依赖项,它总是能很好地工作。如果我不得不猜测的话,问题是它试图安装 libglvnd-dev=1.0.0.2-ubuntu2,而我有 libglvnd0=1.0.0.2-ubuntu2.1

以下是我安装的部分/全部 opengl 包:

sudo apt list --installed | grep libgl

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

libgl1/now 1.0.0-2ubuntu2.1 amd64 [installed,local]
libgl1-mesa-dri/now 18.0.5-0ubuntu0~18.04.1 amd64 [installed,local]
libgl1-mesa-glx/now 18.0.5-0ubuntu0~18.04.1 amd64 [installed,local]
libglapi-mesa/now 18.0.5-0ubuntu0~18.04.1 amd64 [installed,local]
libgles2/now 1.0.0-2ubuntu2.1 amd64 [installed,local]
libglib-object-introspection-perl/bionic,now 0.044-2 amd64 [installed]
libglib-perl/bionic,now 3:1.326-1build1 amd64 [installed]
libglib2.0-0/now 2.56.2-0ubuntu0.18.04.2 amd64 [installed,local]
libglib2.0-bin/now 2.56.2-0ubuntu0.18.04.2 amd64 [installed,local]
libglib2.0-data/now 2.56.2-0ubuntu0.18.04.2 all [installed,local]
libglib2.0-dev/now 2.56.2-0ubuntu0.18.04.2 amd64 [installed,local]
libglib2.0-dev-bin/now 2.56.2-0ubuntu0.18.04.2 amd64 [installed,local]
libglu1-mesa/bionic,now 9.0.0-2.1build1 amd64 [installed]
libglvnd0/now 1.0.0-2ubuntu2.1 amd64 [installed,local]
libglx-mesa0/now 18.0.5-0ubuntu0~18.04.1 amd64 [installed,local]
libglx0/now 1.0.0-2ubuntu2.1 amd64 [installed,local]

所以如果我去:

sudo apt-get install libglu1-mesa-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.
 libglu1-mesa-dev : Depends: libgl1-mesa-dev but it is not going to be installed or
                             libgl-dev
E: Unable to correct problems, you have held broken packages.

或者:

sudo apt-get install libgl-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'libgl1-mesa-dev' instead of 'libgl-dev'
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.
 libgl1-mesa-dev : Depends: libglvnd-dev but it is not going to be installed
                   Depends: libx11-xcb-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

然后:

sudo apt-get install libglvnd-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.
 libglvnd-dev : Depends: libglvnd0 (= 1.0.0-2ubuntu2) but 1.0.0-2ubuntu2.1 is to be installed
                Depends: libegl1 (= 1.0.0-2ubuntu2) but 1.0.0-2ubuntu2.1 is to be installed
                Depends: libgles2 (= 1.0.0-2ubuntu2) but 1.0.0-2ubuntu2.1 is to be installed
                Depends: libgl1 (= 1.0.0-2ubuntu2) but 1.0.0-2ubuntu2.1 is to be installed
                Depends: libglx0 (= 1.0.0-2ubuntu2) but 1.0.0-2ubuntu2.1 is to be installed
                Depends: libopengl0 (= 1.0.0-2ubuntu2) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

因此,如果我尝试指定相同版本的 libglvnd-dev:

sudo apt-get install libglvnd-dev=1.0.0-2ubuntu2.1
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Version ‘1.0.0-2ubuntu2.1’ for ‘libglvnd-dev’ was not found

如果我尝试将 libglvnd0 降级到 1.0.0-2ubuntu2,它似乎会破坏大量 gnome 组件。

有人可以建议下一步措施吗?

谢谢

(编辑:代码格式)

相关内容