I was faced with the following problem when trying to install freeglut3-dev. I'm curious why I got this problem in the first place, and what, if anything, I should have done differently.
This is on Debian 9.11, sources.list is at the bottom of this question.
# apt-get install freeglut3-dev
The following packages have unmet dependencies:
freeglut3-dev : Depends: libgl1-mesa-dev but it is not going to be installed or
libgl-dev
Depends: libglu1-mesa-dev but it is not going to be installed or
libglu-dev
E: Unable to correct problems, you have held broken packages.
So I decided to try figure out what the problem is myself.
# apt-get install libgl1-mesa-dev
The following packages have unmet dependencies:
libgl1-mesa-dev : Depends: mesa-common-dev (= 13.0.6-1+b2) but it is not going to be installed
Depends: libdrm-dev (>= 2.4.69) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
# apt-get install mesa-common-dev
The following packages have unmet dependencies:
mesa-common-dev : Depends: libdrm-dev (>= 2.4.65) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
# apt-get install libdrm-dev
The following packages have unmet dependencies:
libdrm-dev : Depends: libdrm2 (= 2.4.74-1) but 2.4.95-1~bpo9+1 is to be installed
E: Unable to correct problems, you have held broken packages.
# apt-get install libdrm2
libdrm2 is already the newest version (2.4.95-1~bpo9+1)
So I have this installed.
I try to install the older version, manually:
First, do I have the older version available?
# apt-cache policy libdrm2
libdrm2:
Installed: 2.4.95-1~bpo9+1
Candidate: 2.4.95-1~bpo9+1
Version table:
*** 2.4.95-1~bpo9+1 100
100 /var/lib/dpkg/status
2.4.74-1 500
500 http://deb.debian.org/debian stretch/main amd64 Packages
Looks like it. Let's roll.
# apt-get install libdrm2=2.4.74-1
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
audacious-plugins-data compton-conf-l10n libaudcore3 libaudgui3 libaudtag2
libc-ares2 libcddb2 libcue1 libdouble-conversion1 libdrm-common libevdev2
libfluidsynth1 libglvnd0 libguess1 libinput-bin libinput10 libmaxminddb0
libmms0 libmodplug1 libmtdev1 libneon27-gnutls libpcre16-3 libqt5core5a
libqt5dbus5 libqt5network5 libsbc1 libsdl-ttf2.0-0 libsdl2-2.0-0
libsidplayfp4 libsmi2ldbl libspandsp2 libwacom-bin libwacom-common libwacom2
libwayland-server0 libwireshark-data libwireshark11 libwiretap8 libwscodecs2
libwsutil9 libxatracker2 libxcb-icccm4 libxcb-image0 libxcb-keysyms1
libxcb-randr0 libxcb-render-util0 libxcb-xfixes0 libxcb-xinerama0
libxcb-xkb1 libxfont2 libxkbcommon-x11-0 qttranslations5-l10n
wireshark-common x11-apps x11-session-utils xfonts-100dpi xfonts-75dpi
xfonts-base xfonts-scalable xinit xserver-common xserver-xorg-legacy
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
audacious audacious-plugins compton-conf libaudqt0 libegl-mesa0 libegl1
libegl1-mesa libgbm1 libqgsttools-p1 libqt5gui5 libqt5multimedia5
libqt5multimedia5-plugins libqt5multimediawidgets5 libqt5opengl5
libqt5printsupport5 libqt5svg5 libqt5widgets5 libqt5x11extras5
libwayland-egl1-mesa qt5-gtk-platformtheme virtualbox-5.2 wireshark
wireshark-qt xorg xserver-xorg xserver-xorg-core xserver-xorg-input-all
xserver-xorg-input-libinput xserver-xorg-input-wacom xserver-xorg-video-all
xserver-xorg-video-amdgpu xserver-xorg-video-ati xserver-xorg-video-fbdev
xserver-xorg-video-intel xserver-xorg-video-nouveau xserver-xorg-video-qxl
xserver-xorg-video-radeon xserver-xorg-video-vesa xserver-xorg-video-vmware
The following packages will be DOWNGRADED:
libdrm2
0 upgraded, 0 newly installed, 1 downgraded, 39 to remove and 0 not upgraded.
Need to get 36.2 kB of archives.
After this operation, 209 MB disk space will be freed.
Do you want to continue? [Y/n]
Get:1 http://deb.debian.org/debian stretch/main amd64 libdrm2 amd64 2.4.74-1 [36.2 kB]
Fetched 36.2 kB in 0s (153 kB/s)
(Reading database ... 336865 files and directories currently installed.)
Removing audacious (3.7.2-1+b1) ...
Removing audacious-plugins:amd64 (3.7.2-2.1) ...
Removing compton-conf (0.2.1-2) ...
Removing libaudqt0:amd64 (3.7.2-1+b1) ...
Removing xorg (1:7.7+19) ...
Removing xserver-xorg (1:7.7+19) ...
Removing xserver-xorg-video-all (1:7.7+19) ...
Removing xserver-xorg-video-vmware (1:13.2.1-1+b1) ...
Removing xserver-xorg-video-vesa (1:2.3.4-1+b2) ...
Removing xserver-xorg-input-all (1:7.7+19) ...
Removing xserver-xorg-input-libinput (0.23.0-2) ...
Removing xserver-xorg-video-qxl (0.1.4+20161126git4d7160c-1) ...
Removing xserver-xorg-video-nouveau (1:1.0.13-3) ...
Removing xserver-xorg-input-wacom (0.34.0-1) ...
Removing virtualbox-5.2 (5.2.34-133893~Debian~stretch) ...
Removing libwayland-egl1-mesa:amd64 (18.2.8-2~bpo9+1) ...
Removing xserver-xorg-video-amdgpu (1.2.0-1+b1) ...
Removing libqt5multimedia5-plugins:amd64 (5.7.1~20161021-2) ...
Removing libqgsttools-p1:amd64 (5.7.1~20161021-2) ...
Removing wireshark (2.6.7-1~deb9u1) ...
Removing wireshark-qt (2.6.7-1~deb9u1) ...
Removing libqt5multimediawidgets5:amd64 (5.7.1~20161021-2) ...
Removing libqt5multimedia5:amd64 (5.7.1~20161021-2) ...
Removing libqt5opengl5:amd64 (5.7.1+dfsg-3+deb9u1) ...
Removing libqt5printsupport5:amd64 (5.7.1+dfsg-3+deb9u1) ...
Removing libqt5svg5:amd64 (5.7.1~20161021-2+b2) ...
Removing libqt5widgets5:amd64 (5.7.1+dfsg-3+deb9u1) ...
Removing libqt5x11extras5:amd64 (5.7.1~20161021-2) ...
Removing qt5-gtk-platformtheme:amd64 (5.7.1+dfsg-3+deb9u1) ...
Removing xserver-xorg-video-ati (1:7.8.0-1+b1) ...
Removing xserver-xorg-video-fbdev (1:0.4.4-1+b5) ...
Removing xserver-xorg-video-intel (2:2.99.917+git20161206-1) ...
Removing xserver-xorg-video-radeon (1:7.8.0-1+b1) ...
Removing xserver-xorg-core (2:1.19.2-1+deb9u5) ...
Removing libqt5gui5:amd64 (5.7.1+dfsg-3+deb9u1) ...
Removing libegl1-mesa:amd64 (18.2.8-2~bpo9+1) ...
Removing libegl1:amd64 (1.1.0-1~bpo9+1) ...
Removing libegl-mesa0:amd64 (18.2.8-2~bpo9+1) ...
Removing libgbm1:amd64 (18.2.8-2~bpo9+1) ...
dpkg: warning: downgrading libdrm2:amd64 from 2.4.95-1~bpo9+1 to 2.4.74-1
(Reading database ... 335466 files and directories currently installed.)
Preparing to unpack .../libdrm2_2.4.74-1_amd64.deb ...
Unpacking libdrm2:amd64 (2.4.74-1) over (2.4.95-1~bpo9+1) ...
Processing triggers for mime-support (3.60) ...
Processing triggers for desktop-file-utils (0.23-1) ...
Setting up libdrm2:amd64 (2.4.74-1) ...
Processing triggers for libc-bin (2.24-11+deb9u4) ...
Processing triggers for man-db (2.7.6.1-2) ...
Processing triggers for shared-mime-info (1.8-1+deb9u1) ...
Unknown media type in type 'all/all'
Unknown media type in type 'all/allfiles'
Processing triggers for glx-alternative-mesa (0.8.8~deb9u2) ...
update-alternatives: warning: forcing reinstallation of alternative /usr/lib/mesa-diverted because link group glx is broken
update-alternatives: warning: skip creation of /usr/lib/x86_64-linux-gnu/libEGL.so.1 because associated file /usr/lib/mesa-diverted/x86_64-linux-gnu/libEGL.so.1 (of link group glx) doesn't exist
Processing triggers for hicolor-icon-theme (0.15-1) ...
Processing triggers for libc-bin (2.24-11+deb9u4) ...
Ok, so it removed all of those packages, some of which are pretty essential, without reinstalling them? This is confirmed when I look in history.log for apt.
I guess I'll install them manually then, and hopefully it doesn't upgrade libdrm2 in the process ...
# apt-get install audacious-plugins-data compton-conf-l10n libaudcore3 libaudgui3 libaudtag2 libc-ares2 libcddb2 libcue1 libdouble-conversion1 libdrm-common libevdev2 libfluidsynth1 libglvnd0 libguess1 libinput-bin libinput10 libmaxminddb0 libmms0 libmodplug1 libmtdev1 libneon27-gnutls libpcre16-3 libqt5core5a libqt5dbus5 libqt5network5 libsbc1 libsdl-ttf2.0-0 libsdl2-2.0-0 libsidplayfp4 libsmi2ldbl libspandsp2 libwacom-bin libwacom-common libwacom2 libwayland-server0 libwireshark-data libwireshark11 libwiretap8 libwscodecs2 libwsutil9 libxatracker2 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xfixes0 libxcb-xinerama0 libxcb-xkb1 libxfont2 libxkbcommon-x11-0 qttranslations5-l10n wireshark-common x11-apps x11-session-utils xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable xinit xserver-common xserver-xorg-legacy
However, now I'm told these are already the latest version.
At this point, I'm not sure what's going on.
Anyway, I'm able to install freeglut3-dev now, it stopped complaining.
I'm not sure I really know what I'm doing, and might have gotten close to breaking my system here.
My sources.list:
deb http://deb.debian.org/debian/ stretch main contrib non-free
deb-src http://deb.debian.org/debian/ stretch main contrib non-free
deb http://security.debian.org/debian-security stretch/updates main contrib non-free
deb-src http://security.debian.org/debian-security stretch/updates main contrib non-free
# stretch-updates, previously known as 'volatile'
deb http://deb.debian.org/debian/ stretch-updates main contrib non-free
deb-src http://deb.debian.org/debian/ stretch-updates main contrib non-free
# Virtualbox
deb http://download.virtualbox.org/virtualbox/debian stretch contrib non-free