#1061478 apt: Internal Error, AutoRemover broke stuff, unmet dependencies: linux-headers-6.6.9-amd64

Package:
apt
Source:
apt
Description:
commandline package manager
Submitter:
greg
Date:
2024-01-25 16:54:03 UTC
Severity:
normal
#1061478#5
Date:
2024-01-25 05:49:00 UTC
From:
To:
Make update everey day (as sudo):

apt update
apt full-upgrade

mm, seems like the AutoRemover destroyed something which really
shouldn't happen. Please file a bug report against apt.

The following information may help to resolve the situation:

The following packages have unmet dependencies:
 linux-headers-6.6.9-amd64 : Depends: linux-image-6.6.9-amd64 (= 6.6.9-1+b1)
but it is not installable or
                                      linux-image-6.6.9-amd64-unsigned (=
6.6.9-1+b1) but it is not going to be installed
E: Internal Error, AutoRemover broke stuff

#1061478#10
Date:
2024-01-25 16:45:06 UTC
From:
To:
Hi,

TL;DR

One can currently reproduce this behavior on unstable by doing:

```
apt-get install linux-headers-6.6.9-amd64
dpkg -r --force-depends linux-image-6.6.9-amd64-unsigned
apt-get full-upgrade
```

You can fix it by either running:

```
apt-get remove linux-headers-6.6.9-amd64
# or
apt-mark auto linux-headers-6.6.9-amd64
# or but it doesn't make sense
apt --fix-broken install
```

I came across this scenario myself as well and on Reddit. This is my
take on it.

Around the 11th, linux-image-6.6.9-amd64 was installed. And around the
18th, linux-image-6.6.11-amd64. During the .9 install I saw similar
things, I chose to keep everything as is. This caused me to keep running
on the 6.6.8 kernel at the time.

I think something went wrong with the linux-headers-6.6.9-amd64 and/or
linux-image-6.6.9-amd64 package. For instance, I didn't have the
linux-headers-6.6.9-amd64 installed while I had
linux-headers-6.6.8-amd64 and  linux-headers-6.6.11-amd64 installed. The
package linux-image-6.6.9-amd64 isn't available in the repositories
(anymore):

```
$ apt-cache policy linux-image-6.6.9-amd64
linux-image-6.6.9-amd64:
   Installed: (none)
   Candidate: (none)
   Version table:
      6.6.9-1 -1
         100 /var/lib/dpkg/status
```

The dependency tree is sorta broken of 6.6.9. The headers have these
dependencies:

```
$ apt-cache depends linux-headers-6.6.9-amd64
linux-headers-6.6.9-amd64
   Depends: linux-headers-6.6.9-common
  |Depends: linux-image-6.6.9-amd64
   Depends: linux-image-6.6.9-amd64-unsigned
   Depends: linux-kbuild-6.6.9
   Depends: gcc-13
```

Your linux-image-amd64 package depends on:
```
$ apt-cache depends linux-image-amd64
linux-image-amd64
   Depends: linux-image-6.6.13-amd64
```

So now one of your packages is broken. I think it is warrants a look
into your /var/log/apt/history.log to try to figure out what happened to
your linux-{image,headers}-* packages around the 11th, 18th and later on.

Cheers,
Wesley