尝试编译一个简单的 c++ 作业,它告诉我 GL/glu.h 不存在。四处搜索让我相信我至少需要以下 3 或 4 个包:libgl-dev、libgl1、libgl1-dev、libglu-dev、libglx、libglx0、libglu1-mesa-dev 等等。
sudo aptitude install libglu-dev
给了我这个:
The following packages have unmet dependencies:
libgles-dev : Depends: libgles2 (= 1.3.1-1) but 1.3.1-1ubuntu0.20.04.1 is installed
libglx-dev : Depends: libglx0 (= 1.3.1-1) but 1.3.1-1ubuntu0.20.04.1 is installed
libopengl0 : Depends: libglvnd0 (= 1.3.1-1) but 1.3.1-1ubuntu0.20.04.1 is installed
libgles1 : Depends: libglvnd0 (= 1.3.1-1) but 1.3.1-1ubuntu0.20.04.1 is installed
libegl-dev : Depends: libegl1 (= 1.3.1-1) but 1.3.1-1ubuntu0.20.04.1 is installed
libglvnd-dev : Depends: libglvnd0 (= 1.3.1-1) but 1.3.1-1ubuntu0.20.04.1 is installed
libgl-dev : Depends: libgl1 (= 1.3.1-1) but 1.3.1-1ubuntu0.20.04.1 is installed
它们看起来像是这些库的相同版本,但在末尾添加了“ubuntu ...”。
我能以某种方式告诉系统安装
libgl1 is already the newest version (1.3.1-1ubuntu0.20.04.1).
满足 libgl-dev 的依赖性吗?
根据下面的评论我确实
sudo apt install --fix-missing
输出了:
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
更新:我能够通过驳回('n')来自 aptitude 的第一个建议并接受第二个建议来“解决”这个问题:
Downgrade the following packages:
1) libegl1 [1.3.1-1ubuntu0.20.04.1 (now) -> 1.3.1-1 (focal)]
2) libgl1 [1.3.1-1ubuntu0.20.04.1 (now) -> 1.3.1-1 (focal)]
3) libgl1:i386 [1.3.1-1ubuntu0.20.04.1 (now) -> 1.3.1-1 (focal)]
4) libgles2 [1.3.1-1ubuntu0.20.04.1 (now) -> 1.3.1-1 (focal)]
5) libglvnd0 [1.3.1-1ubuntu0.20.04.1 (now) -> 1.3.1-1 (focal)]
6) libglvnd0:i386 [1.3.1-1ubuntu0.20.04.1 (now) -> 1.3.1-1 (focal)]
7) libglx0 [1.3.1-1ubuntu0.20.04.1 (now) -> 1.3.1-1 (focal)]
8) libglx0:i386 [1.3.1-1ubuntu0.20.04.1 (now) -> 1.3.1-1 (focal)]
致命错误已经消失(软件包中仍然有一堆不相关的错误,但那将是另一天的事了)