#870322 apt: AutoRemover broke stuff

Package:
apt
Source:
apt
Description:
commandline package manager
Submitter:
Henry Keli
Date:
2026-07-08 14:19:02 UTC
Severity:
important
Tags:
#870322#5
Date:
2017-08-01 01:24:23 UTC
From:
To:
Dear Maintainer,
I enabled the sources for 'testing' alongside sources for stable. I used apt-
pinning to prefer ONLY packages from stable. I upgraded my system but
carelessly, I upgraded to testing, as my I miss-spelled the 'preferences' file
for apt-pinning. I corrected my pinning and tried to sync with stable by making
use of apt-pinning to downgrade my packages. First, I updated my apt packages
list (apt update), then I ran an apt upgrade. When I tried to run apt dist-
upgrade, I received the following message:
----------

Reading state information... Done
Calculating upgrade... Done
Hmm, 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:
 libidn2-0:i386 : Depends: libunistring0:i386 but it is not going to be
installed
E: Internal Error, AutoRemover broke stuff
---------- This is what my sources.list looks like: deb http://deb.debian.org/debian stable main contrib non-free deb-src http://deb.debian.org/debian stable main contrib non-free deb http://deb.debian.org/debian stable-updates main contrib non-free deb-src http://deb.debian.org/debian stable-updates main contrib non-free deb http://security.debian.org/ stable/updates main contrib non-free deb-src http://security.debian.org/ stable/updates main contrib non-free deb http://deb.debian.org/debian testing main contrib non-free deb-src http://deb.debian.org/debian testing main contrib non-free deb http://deb.debian.org/debian testing-updates main contrib non-free deb-src http://deb.debian.org/debian testing-updates main contrib non-free deb http://security.debian.org/ testing/updates main contrib non-free deb-src http://security.debian.org/ testing/updates main contrib non-free
#870322#10
Date:
2017-10-14 06:07:18 UTC
From:
To:
Hey, I think I ran into this same bug. Was just doing a dist-upgrade
when it occurred.

I have a S/T/U/E setup with pinning following the guide over at
serverfault.com/questions/22414/how-can-i-run-debian-stable-but-install-some-packages-from-testing

apt 1.4.8 (amd64)

I am getting the error:

Hmm, 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:
 libavcodec57 : Depends: libx264-148 but it is not going to be installed
                Depends: libx265-95 (>= 2.1) but it is not going to be installed
 libavcodec57:i386 : Depends: libtwolame0:i386 (>= 0.3.10) but it is
not going to be installed
                     Depends: libwavpack1:i386 (>= 4.40.0) but it is
not going to be installed
                     Depends: libwebp6:i386 (>= 0.5.1) but it is not
going to be installed
                     Depends: libwebpmux2:i386 (>= 0.5.1) but it is
not going to be installed
                     Depends: libx264-148:i386 but it is not going to
be installed
                     Depends: libx265-95:i386 (>= 2.1) but it is not
going to be installed
E: Internal Error, AutoRemover broke stuff

#870322#15
Date:
2017-12-07 14:21:49 UTC
From:
To:
Dear Maintainer,

*** Reporter, please consider answering these questions, where appropriate ***

   * What led up to the situation?
   * What exactly did you do (or not do) that was effective (or
     ineffective)?
   * What was the outcome of this action?
   * What outcome did you expect instead?

    I wanted to ping a testing package.  Beforehand I had no preference in effect.

    Events unfolding:

    apt-get update
    apt-get upgrade
    # -> turned up nothing, system is up-to-date

    apt-get autoremove
    # -> nothing happened

    # added preferences for security, stable and unstable in preferences.d
    # added testing lines to sources.list:
    deb http://ftp.hu.debian.org/debian/ testing main contrib non-free
    deb-src http://ftp.hu.debian.org/debian/ testing main contrib non-free

    apt-get update
    apt-get upgrade
    # -> nothing happened

    ###       ###
    ### ERROR ###
    ###       ###

    apt-get dist-upgrade
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Calculating upgrade... Done
    Hmm, 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:
     libavcodec57 : Depends: libx264-148 but it is not going to be installed
                     Depends: libx265-95 (>= 2.1) but it is not going to be installed
    E: Internal Error, AutoRemover broke stuff

    # So, I went on to disable the testing lines in the sources.list and try to resolve the situation:
    #deb http://ftp.hu.debian.org/debian/ testing main contrib non-free
    #deb-src http://ftp.hu.debian.org/debian/ testing main contrib non-free

    apt-get update
    apt-get upgrade
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Calculating upgrade... Done
    The following packages will be DOWNGRADED:
      bind9-host dnsutils ffmpeg freerdp-x11 host libbind9-140 libdns-export162 libdns162 libfreerdp-cache1.1 libfreerdp-client1.1 libfreerdp-codec1.1
      libfreerdp-common1.1.0 libfreerdp-core1.1 libfreerdp-crypto1.1 libfreerdp-gdi1.1 libfreerdp-locale1.1 libfreerdp-plugins-standard libfreerdp-primitives1.1
      libfreerdp-rail1.1 libfreerdp-utils1.1 libgnutls-openssl27 libgnutls30 libisc-export160 libisc160 libisccc140 libisccfg140 liblwres141 libwinpr-crt0.1
      libwinpr-crypto0.1 libwinpr-dsparse0.1 libwinpr-environment0.1 libwinpr-file0.1 libwinpr-handle0.1 libwinpr-heap0.1 libwinpr-input0.1
      libwinpr-interlocked0.1 libwinpr-library0.1 libwinpr-path0.1 libwinpr-pool0.1 libwinpr-registry0.1 libwinpr-rpc0.1 libwinpr-sspi0.1 libwinpr-synch0.1
      libwinpr-sysinfo0.1 libwinpr-thread0.1 libwinpr-utils0.1 libxfreerdp-client1.1 linux-compiler-gcc-6-x86 linux-kbuild-4.9 linux-libc-dev linux-libc-dev:i386
    0 upgraded, 0 newly installed, 51 downgraded, 0 to remove and 9 not upgraded.
    Need to get 6,808 kB/16.3 MB of archives.
    After this operation, 359 kB disk space will be freed.
    Do you want to continue? [Y/n] n
    Abort.

    # quick check in /var/log/dpkg.log
    # I didn't upgrade anything in the last 4 days.
    # So this is just th security packages.

    # OK, maybe it is the preferences, which I did not remove, so clean up /etc/apt/preferences.d
    rm /etc/apt/preferences.d/*

    apt-get update
    apt-get upgrade
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Calculating upgrade... Done
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

    # hm. recreate stable.pref and security.pref
    apt-get update
    apt-get upgrade
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Calculating upgrade... Done
    The following packages will be DOWNGRADED:
      bind9-host dnsutils ffmpeg freerdp-x11 host libbind9-140 libdns-export162 libdns162 libfreerdp-cache1.1 libfreerdp-client1.1 libfreerdp-codec1.1
      libfreerdp-common1.1.0 libfreerdp-core1.1 libfreerdp-crypto1.1 libfreerdp-gdi1.1 libfreerdp-locale1.1 libfreerdp-plugins-standard libfreerdp-primitives1.1
      libfreerdp-rail1.1 libfreerdp-utils1.1 libgnutls-openssl27 libgnutls30 libisc-export160 libisc160 libisccc140 libisccfg140 liblwres141 libwinpr-crt0.1
      libwinpr-crypto0.1 libwinpr-dsparse0.1 libwinpr-environment0.1 libwinpr-file0.1 libwinpr-handle0.1 libwinpr-heap0.1 libwinpr-input0.1
      libwinpr-interlocked0.1 libwinpr-library0.1 libwinpr-path0.1 libwinpr-pool0.1 libwinpr-registry0.1 libwinpr-rpc0.1 libwinpr-sspi0.1 libwinpr-synch0.1
      libwinpr-sysinfo0.1 libwinpr-thread0.1 libwinpr-utils0.1 libxfreerdp-client1.1 linux-compiler-gcc-6-x86 linux-kbuild-4.9 linux-libc-dev linux-libc-dev:i386
    0 upgraded, 0 newly installed, 51 downgraded, 0 to remove and 9 not upgraded.
    Need to get 6,808 kB/16.3 MB of archives.
    After this operation, 359 kB disk space will be freed.
    Do you want to continue? [Y/n] n
    Abort.

    # seems legit, now try
    apt-get dist-upgrade
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Calculating upgrade... Done
    Hmm, 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:
     libavcodec57 : Depends: libx264-148 but it is not going to be installed
                    Depends: libx265-95 (>= 2.1) but it is not going to be installed
    E: Internal Error, AutoRemover broke stuff


    So the presence of the apt-pinning files somehow:
    1) falsely produces an error report
    2) uncovers otherwise hidden dependency error


    # Let's check libavcodec57!
    dpkg -l | grep libavcodec57
    ii  libavcodec57:amd64                           10:3.3.5-dmo1+deb9u1                        amd64        Library to encode decode multimedia streams - runtime files

    apt-cache show libavcodec57
    # 3 versions of the same package is listed - note that at this point the testing sources are disabled in sources.list!
    # only the relevant stuff:
    Package: libavcodec57
    Version: 10:3.3.5-dmo1+deb9u1
    Maintainer: Christian Marillat <marillat@deb-multimedia.org>
    Depends: libx264-150, libx265-116 (>= 1:2.4)

    Package: libavcodec57
    Version: 7:3.2.9-1~deb9u1
    Maintainer: Debian Multimedia Maintainers <pkg-multimedia-maintainers@lists.alioth.debian.org>
    Depends: libx264-148, libx265-95 (>= 2.1)       ### this triggered the error message! ###

    Package: libavcodec57
    Version: 7:3.2.7-1~deb9u1                       # <- the minor version number is 7 instead of 9
    Maintainer: Debian Multimedia Maintainers <pkg-multimedia-maintainers@lists.alioth.debian.org>
    Depends: libx264-148, libx265-95 (>= 2.1)       ### or this


    Meaning, I have multiple versions of the same package in DB, I have installed the newest version, and now apt thinks an older version is installed, which has unmet dependencies.

    But which repos these packages come from?
    It seems, 1 is from
http://www.deb-multimedia.org
    the other is from debian stable?

    deb-multimedia.org has the installed version:
    libavcodec57 (10:3.3.5-dmo1+deb9u1)

    stretch security has:
    libavcodec57 (7:3.2.9-1~deb9u1)

    no idea, where the
    libavcodec57 (7:3.2.9-1~deb9u1)
    came from...


    I don't know, if having the same package listed with different versions is a legit state, but it seems it can brake things:
    1) no apt-pinnning is in effect
    2) install some_package.version_100 from repo_1
    3) add repo_2, and
    4) set its priority higher than repo_1
    5) repo_2 contains some_package.version_99
    6) upgrade works, since it does not want to touch some_package
    7) dist-upgrade fails, since it wants to downgrade some_package, but somehow fails to find a solution and it reports (it seems, incorrectly) that apt-get autoremove has broken stuff.


*** End of the template - remove these template lines ***

#870322#20
Date:
2026-07-08 14:17:40 UTC
From:
To:
Dear Maintainer,

I'm seeing the same/similar issue. This is what happens when I do
`apt upgrade --auto-remove`:

```
27 packages can be upgraded. Run 'apt list --upgradable' to see them.
Hmm, 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:

Unsatisfied dependencies:
 libtext-csv-xs-perl : Depends: libencode-perl (>= 3.24)
```

When I do `apt upgrade` without `--auto-remove`, it seems the reason is that it
tries to remove the package that it will also add back later as a new
dependency:

```
The following package was automatically installed and is no longer required:
  libencode-perl
Use 'sudo apt autoremove' to remove it.

Upgrading:
  bolt                  kubectl                libkf6coreaddons6        libpam-runtime  libsrtp2-1           python-tinycss2-common  python3-tinycss2
  gettext-base          libdbi-perl            liblatex-tounicode-perl  libpam0g        libtext-csv-xs-perl  python3-inflate64       qml6-module-org-kde-coreaddons
  google-chrome-stable  libio-socket-ssl-perl  libpam-modules           libserd-0-0     libtiff6             python3-inflect         ruby-webrick
  google-cloud-cli      libkf6coreaddons-data  libpam-modules-bin       libskia146      libyajl2             python3-pyyaml-env-tag

Installing dependencies:
  libencode-perl

Summary:
  Upgrading: 27, Installing: 1, Removing: 0, Not Upgrading: 0
  Download size: 368 MB
  Space needed: 10.3 MB / 678 GB available
```