Eu me deparei com o seguinte problema ao tentar instalar o freeglut3-dev. Estou curioso para saber por que tive esse problema em primeiro lugar e o que, se houver, eu deveria ter feito de maneira diferente.
Isso está no Debian 9.11, sources.list está no final desta pergunta.
# 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.
Então eu decidi tentar descobrir qual é o problema eu mesmo.
# 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)
Então eu tenho isso instalado.
Eu tento instalar a versão mais antiga, manualmente:
Primeiro, tenho a versão mais antiga disponível?
# 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
Parece que sim. Vamos rolar.
# 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, então ele removeu todos esses pacotes, alguns dos quais são bastante essenciais, sem reinstalá-los? Isso é confirmado quando procuro no history.log pelo apt.
Acho que vou instalá-los manualmente e espero que não atualize o libdrm2 no processo ...
# 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
No entanto, agora me disseram que estas já são a versão mais recente.
Neste ponto, não tenho certeza do que está acontecendo.
De qualquer forma, consigo instalar o freeglut3-dev agora, parou de reclamar.
Não tenho certeza se realmente sei o que estou fazendo, e posso ter chegado perto de quebrar meu sistema aqui.
Minha lista de fontes:
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
Esta é a raiz do problema:
Isso indica que você instalou a
libdrm2
partir de backports do Stretch em algum momento e também que os backports não estão mais configurados em seus repositórios.Quando você correu
você pediu
apt-get
para fazer o downgradelibdrm2
. Nesse cenário,apt-get
não faz downgrade de pacotes relacionados por conta própria; ele verifica as dependências resultantes e remove quaisquer pacotes cujas dependências não sejam mais satisfeitas. Neste caso, outros pacotes que você instalou a partir de backports, e que tinham uma dependêncialibdrm2
mais recente que 2.4.74, seriam removidos:libegl1
etc. Pacotes dependentes destes também seriam removidos; isso incluixserver-xorg-core
. O processo continua até que nenhum pacote seja deixado com dependências insatisfeitas...Você não quebrou seu sistema; isso requer confirmações adicionais. Você
apt-get install
não fez nada particularmente útil porque forneceu a lista de pacotes que agora são candidatos à remoção automática; esses pacotes ainda estão instalados. Para desfazer as remoções, você deve instalar os pacotes que foram removidos: