LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   you have held broken packages (https://www.linuxquestions.org/questions/debian-26/you-have-held-broken-packages-4175674941/)

Thomas#555 05-10-2020 07:05 AM

you have held broken packages
 
I am no expert, but know enough to use Debian 10 Buster as my daily driver for not-work using bspwm and polybar. I can just about use nvim. I can't diagnose and solve real issues though.

The network crapping out defeated my last week. I reinstalled before realising it was the LAN port borking (it worked fine under W10 under my dual boot).

I have had a happy (genuinely!) week getting everything 'just-so' again having backed up my home directory. But I now have a problem that will make me reinstall in the natural way of things, but I want to learn more so here we are.

I am getting weird apt issues. eg.

Code:

me@debian:~$ sudo apt install qt5-default
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:
 qt5-default : Depends: qtbase5-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
me@debian:~$ sudo apt install qtbase5-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:
 qtbase5-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.

I initially had the same issue with qt4 - but managed to solve it by finding the one base package the other depend on. This then broke qt5. I need qt5 to compile something I was using before this problem.

What may have caused it:
I did edit my sources.list to add contrib non-free
I did accidentally add a sid source to my sources.list
I have removed both changes.

What I have tried... Lots. I manually went through this script too:
Code:

#!/bin/bash
sudo cp -arf /var/lib/dpkg /var/lib/dpkg.backup
sudo cp /var/lib/dpkg/status-old /var/lib/dpkg/status
sudo cp /var/lib/dpkg/available-old /var/lib/dpkg/available
sudo rm -rf /var/lib/dpkg/updates/*
sudo rm -rf /var/lib/apt/lists
sudo mkdir /var/lib/apt/lists
sudo mkdir /var/lib/apt/lists/partial
sudo apt-get clean
sudo apt-get update
sudo dpkg --clear-avail
sudo dpkg --configure -a
sudo apt-get install -f
sudo apt-get update
sudo apt-get dist-upgrade

I have tried adding the missing dependencies to my install, but eventually run up against this, which is beyond me.
Code:

me@debian:~$ sudo apt install qt5-default qtbase5-dev libgl1-mesa-dev 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:
 libgl1-mesa-dev : Depends: libx11-xcb-dev but it is not going to be installed
 libglvnd-dev : Depends: libglvnd0 (= 1.1.0-1) but 1.3.1-1 is to be installed
                Depends: libegl1 (= 1.1.0-1) but 1.3.1-1 is to be installed
                Depends: libgles1 (= 1.1.0-1) but it is not going to be installed
                Depends: libgles2 (= 1.1.0-1) but 1.3.1-1 is to be installed
                Depends: libgl1 (= 1.1.0-1) but 1.3.1-1 is to be installed
                Depends: libglx0 (= 1.1.0-1) but 1.3.1-1 is to be installed
                Depends: libopengl0 (= 1.1.0-1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

I am at a loss and will reinstall eventually, is there any guru out there who can save me?

shruggy 05-10-2020 07:15 AM

Quote:

Originally Posted by Thomas#555 (Post 6121344)
What I have tried... Lots.

Seems you haven't tried dpkg -C yet. Won't fix anything by itself, but may give you useful hints.

Thomas#555 05-10-2020 07:23 AM

Code:

sudo dpkg -C
Did nothing. Just went to the next line.

The same problem persists.

shruggy 05-10-2020 07:40 AM

Quote:

Originally Posted by Thomas#555 (Post 6121344)
libglvnd-dev : Depends: libglvnd0 (= 1.1.0-1) but 1.3.1-1 is to be installed

Are you sure you disabled all sid repositories? 1.1.0 is the version in Buster, 1.3.1 in Bullseye/sid.

Thomas#555 05-10-2020 07:49 AM

This is my current /etc/apt/sources.list

Code:

deb http://deb.debian.org/debian/ buster main                                 
deb-src http://deb.debian.org/debian/ buster main                             
                                                                               
deb http://security.debian.org/debian-security buster/updates main             
deb-src http://security.debian.org/debian-security buster/updates main         
                                                                               
# buster-updates, previously known as 'volatile'                               
deb http://deb.debian.org/debian/ buster-updates main                         
deb-src http://deb.debian.org/debian/ buster-updates main

in /etc/apt/sources.list.d there is one file which is the microsoft source for Teams (I know - don't ask). I had forgotten to look in that directory. Not sure where else to look though for stray entries. I commented out the Teams entry, did an apt update but the same problem persists.

So we have a smoking gun... Where else can I look for sources?

shruggy 05-10-2020 07:53 AM

If sid is not in sources.list then the packages in question are already downloaded from sid and sit in /var/cache/apt/archives waiting to be installed.

Thomas#555 05-10-2020 07:56 AM

Code:

~$sudo ls /var/cache/apt/archives
lock  partial
~$ sudo ls /var/cache/apt/archives/partial/
~$

:(

shruggy 05-10-2020 08:01 AM

Two questions.

1. Have you by chance installed something like apt-cacher-ng?
2. Can you install aptitude?

Thomas#555 05-10-2020 08:04 AM

Code:

apt search apt-cacher-ng
Sorting... Done
Full Text Search... Done
apt-cacher-ng/stable 3.2.1-1 amd64
  caching proxy server for software repositories

auto-apt-proxy/stable 11 all
  automatic detector of common APT proxy settings

So I don't think it is installed.

Yes, I can (and just did) install aptitude.

Thomas#555 05-10-2020 08:06 AM

Code:

sudo aptitude install qt5-default
The following NEW packages will be installed:
  libdouble-conversion1{a} libdrm-dev{a} libgl1-mesa-dev{a} libgles1{ab} libglu1-mesa{a} libglu1-mesa-dev{a} libglvnd-core-dev{a} libglvnd-dev{ab} libopengl0{ab} libpcre2-16-0{a} libqt5concurrent5{a}
  libqt5core5a{a} libqt5dbus5{a} libqt5gui5{a} libqt5network5{a} libqt5opengl5{a} libqt5opengl5-dev{a} libqt5printsupport5{a} libqt5sql5{a} libqt5sql5-sqlite{a} libqt5svg5{a} libqt5test5{a}
  libqt5widgets5{a} libqt5xml5{a} libvulkan-dev{a} libvulkan1{a} libx11-xcb-dev{ab} libxcb-dri2-0-dev{a} libxcb-dri3-dev{a} libxcb-glx0-dev{a} libxcb-present-dev{a} libxcb-render-util0{a}
  libxcb-sync-dev{a} libxdamage-dev{a} libxfixes-dev{a} libxshmfence-dev{a} libxxf86vm-dev{a} mesa-common-dev{a} qt5-default qt5-gtk-platformtheme{a} qt5-qmake{a} qt5-qmake-bin{a} qtbase5-dev{a}
  qtbase5-dev-tools{a} qttranslations5-l10n{a} x11proto-damage-dev{a} x11proto-fixes-dev{a} x11proto-xf86vidmode-dev{a}
0 packages upgraded, 48 newly installed, 0 to remove and 0 not upgraded.
Need to get 16.6 MB of archives. After unpacking 82.0 MB will be used.
The following packages have unmet dependencies:
 libx11-xcb-dev : Depends: libx11-xcb1 (= 2:1.6.7-1) but 2:1.6.9-2 is installed
 libopengl0 : Depends: libglvnd0 (= 1.1.0-1) but 1.3.1-1 is installed
 libgles1 : Depends: libglvnd0 (= 1.1.0-1) but 1.3.1-1 is installed
 libglvnd-dev : Depends: libglvnd0 (= 1.1.0-1) but 1.3.1-1 is installed
                Depends: libegl1 (= 1.1.0-1) but 1.3.1-1 is installed
                Depends: libgles2 (= 1.1.0-1) but 1.3.1-1 is installed
                Depends: libgl1 (= 1.1.0-1) but 1.3.1-1 is installed
                Depends: libglx0 (= 1.1.0-1) but 1.3.1-1 is installed
The following actions will resolve these dependencies:

    Keep the following packages at their current version:
1)    libgl1-mesa-dev [Not Installed]                   
2)    libgles1 [Not Installed]                         
3)    libglu1-mesa-dev [Not Installed]                 
4)    libglvnd-dev [Not Installed]                     
5)    libopengl0 [Not Installed]                       
6)    libqt5opengl5-dev [Not Installed]                 
7)    libx11-xcb-dev [Not Installed]                   
8)    qt5-default [Not Installed]                       
9)    qtbase5-dev [Not Installed]                       



Accept this solution? [Y/n/q/?]

Interesting! What to press... Going for n for now.

How do I downgrade stuff? I am guessing I did an apt upgrade whilst the rogue sid was in place.

shruggy 05-10-2020 08:06 AM

Code:

sudo apt install libx11-xcb1=2:1.6.7-1

Thomas#555 05-10-2020 08:08 AM

I think the issue was my installing kitty terminal - I think that is why I put the rogue entry in. I clicked n and was offered thusly:

Code:

Accept this solution? [Y/n/q/?] n
The following actions will resolve these dependencies:

    Remove the following packages:                             
1)    kitty [0.17.3-1 (now)]                                   

    Downgrade the following packages:                         
2)    gstreamer1.0-gl [1.16.2-4 (now) -> 1.14.4-2 (stable)]   
3)    libegl1 [1.3.1-1 (now) -> 1.1.0-1 (stable)]             
4)    libgl1 [1.3.1-1 (now) -> 1.1.0-1 (stable)]               
5)    libgles2 [1.3.1-1 (now) -> 1.1.0-1 (stable)]             
6)    libglvnd0 [1.3.1-1 (now) -> 1.1.0-1 (stable)]           
7)    libglx0 [1.3.1-1 (now) -> 1.1.0-1 (stable)]             
8)    libgstreamer-gl1.0-0 [1.16.2-4 (now) -> 1.14.4-2 (stable)]
9)    libx11-xcb1 [2:1.6.9-2 (now) -> 2:1.6.7-1 (stable)]     



Accept this solution? [Y/n/q/?]

Going for Y (but not in kitty terminal)

shruggy 05-10-2020 08:09 AM

Yes, that should work.

Thomas#555 05-10-2020 08:11 AM

So I now need to work out how to do a batch downgrade. @shruggy - thank you so much.

Thomas#555 05-10-2020 08:15 AM

Quote:

Originally Posted by shruggy (Post 6121360)
Code:

apt install libx11-xcb1=2:1.6.7-1

I am guessing there is a way to list all the packages that are versions beyond what is buster and then to downgrade them.

An easier way is to use aptitude to fix it each time... Think I will go for the latter.

Cheers!

shruggy 05-10-2020 08:19 AM

Quote:

Originally Posted by Thomas#555 (Post 6121363)
how to do a batch downgrade

Try
Code:

sudo apt install ^lib{'e?gl.*',x11-xcb1}/buster gstreamer.\*-gl/buster

Thomas#555 05-10-2020 08:24 AM

I got an instant monster list that I can't get in to a file (>> just does the first two lines) here is some of it:
Code:

Note, selecting 'glade' for glob '*gl*'
Note, selecting 'giggle' for glob '*gl*'
Note, selecting 'librust-encoding-index-singlebyte-1.20141219-dev' for glob '*gl*'
Note, selecting 'libglobus-gass-copy-doc' for glob '*gl*'
Note, selecting 'libxmmsclient-glib-dev' for glob '*gl*'
E: Release 'stable' for 'libglu1' was not found
E: Release 'stable' for 'apertium-gl-en' was not found
E: Release 'stable' for 'apertium-gl-es' was not found
E: Release 'stable' for 'apertium-gl-pt' was not found
E: Release 'stable' for 'autoconf-gl-macros' was not found
E: Release 'stable' for 'bglibs-doc' was not found

So not sure it worked.

shruggy 05-10-2020 08:29 AM

When installing packages with apt you can always require a package from specific release (package_name/release) provided the repos for that release are enabled in sources.list.

You also can test with apt -s install ... -s means simulate.

shruggy 05-10-2020 09:23 AM

Let's try this (I also edited my post above, that idea with \*gl\* was stupid and dangerous, sorry):
Code:

sudo apt install ^lib{'e?gl.*',x11-xcb1}/buster gstreamer.\*-gl/buster
or you can just start an interactive aptitude session
Code:

sudo aptitude
and resolve conflicts from there. b in aptitude searches for the next broken package.

Thomas#555 05-10-2020 09:27 AM

I'll try the latter later...


All times are GMT -5. The time now is 04:02 AM.