![安装 SDL 库时未满足的依赖关系](https://linux22.com/image/1177805/%E5%AE%89%E8%A3%85%20SDL%20%E5%BA%93%E6%97%B6%E6%9C%AA%E6%BB%A1%E8%B6%B3%E7%9A%84%E4%BE%9D%E8%B5%96%E5%85%B3%E7%B3%BB.png)
我一直在尝试在我的 Ubuntu 18.04 上安装 sdl 库,但已经过去了几个小时,我还是不明白如何实现它。我在谷歌上搜索了很多类似的问题,但都无济于事。使用 apt-get 后,显示以下错误消息:
The following packages have unmet dependencies:
libsdl2-dev : Depends: libegl1-mesa-dev but it is not going to be installed
Depends: libgles2-mesa-dev but it is not going to be installed
Depends: libsdl2-2.0-0 (= 2.0.8+dfsg1-1ubuntu1.18.04.4) but it is not going to be installed
libsdl2-image-2.0-0 : Depends: libsdl2-2.0-0 (>= 2.0.8) but it is not going to be installed
以上是在安装 libsdl2-2.0 时
The following packages have unmet dependencies:
libsdl2-dev : Depends: libegl1-mesa-dev but it is not going to be installed
Depends: libgles2-mesa-dev but it is not going to be installed
这是在安装 libsdl2-dev 时
The following packages have unmet dependencies:
libsdl2-dev : Depends: libegl1-mesa-dev but it is not going to be installed
Depends: libgles2-mesa-dev but it is not going to be installed
这是安装 libsdl2-image-dev 时的第三个
此外,在修复损坏的安装时,会显示以下错误消息:
Unpacking mesa-common-dev:amd64 (20.0.8-0ubuntu1~18.04.1) ...
dpkg: error processing archive /var/cache/apt/archives/mesa-common-dev_20.0.8-0ubuntu1~18.04.1_amd64.deb (--unpack):
trying to overwrite '/usr/include/GL/gl.h', which is also in package libgl-dev:amd64 1.3.2-1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../libegl1-mesa-dev_20.0.8-0ubuntu1~18.04.1_amd64.deb ...
Unpacking libegl1-mesa-dev:amd64 (20.0.8-0ubuntu1~18.04.1) ...
dpkg: error processing archive /var/cache/apt/archives/libegl1-mesa-dev_20.0.8-0ubuntu1~18.04.1_amd64.deb (--unpack):
trying to overwrite '/usr/include/EGL/egl.h', which is also in package libegl-dev:amd64 1.3.2-1
Preparing to unpack .../libgles2-mesa-dev_20.0.8-0ubuntu1~18.04.1_amd64.deb ...
Unpacking libgles2-mesa-dev:amd64 (20.0.8-0ubuntu1~18.04.1) ...
dpkg: error processing archive /var/cache/apt/archives/libgles2-mesa-dev_20.0.8-0ubuntu1~18.04.1_amd64.deb (--unpack):
trying to overwrite '/usr/include/GLES2/gl2.h', which is also in package libgles-dev:amd64 1.3.2-1
Errors were encountered while processing:
/var/cache/apt/archives/mesa-common-dev_20.0.8-0ubuntu1~18.04.1_amd64.deb
/var/cache/apt/archives/libegl1-mesa-dev_20.0.8-0ubuntu1~18.04.1_amd64.deb
/var/cache/apt/archives/libgles2-mesa-dev_20.0.8-0ubuntu1~18.04.1_amd64.deb
编辑:我使用过 aptitude 但没有成功