That's the key design idea behind the new solver, it's not allowed to
remove manually installed packages. The messages aren't quite the most
helpful about that yet.

We have a compat mode with APT::Solver::RemoveManual=1 which I need to
add a command-line argument for, and I'd like to introduce an `apt swap`
command for specifically swapping packages as a semantically different
concept.

It may also be possible that we switch to the compact mode, but it's not
fully sound yet: It guarantees that no manually installed package is
removed if such a solution exists, but it doesn't provide strong
guarantees to how many manually installed packages it removes if it
needs to remove some.*

* It technically provides the guarantee that it orders all manually
installed packages by apt's internal preference and guarantees you not
to remove a more preferable package than the ones that need to be
removed but it may remove less important packages instead of finding
other solutions

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to apt in Ubuntu.
https://bugs.launchpad.net/bugs/2115024

Title:
  Apt fails when it needs to remove a non-specified pacakage

Status in apt package in Ubuntu:
  New

Bug description:
  Two examples:
  1) I wanted to remove libmircore2t64 and everything that depends on it. `apt 
remove libmircore2t64` fails, because there are packages that depend on 
libmircore2t64, and I can't find any way to ask apt to remove those packages.

  2) I have nvidia-driver-570 installed. “apt install nvidia-driver-575” fails, 
with:
  Solving dependencies... Error!
  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:

  Unsatisfied dependencies:
   nvidia-driver-575 : Depends: libnvidia-gl-575 (= 575.57.08-0ubuntu2) but it 
is not going to be installed
                       Depends: nvidia-dkms-575 (<= 575.57.08-1) but it is not 
going to be installed
                       Depends: nvidia-dkms-575 (>= 575.57.08) but it is not 
going to be installed
                       Depends: nvidia-kernel-common-575 (<= 575.57.08-1) but 
it is not going to be installed
                       Depends: nvidia-kernel-common-575 (>= 575.57.08) but it 
is not going to be installed
                       Depends: nvidia-kernel-source-575 (= 575.57.08-0ubuntu2) 
but it is not going to be installed
                       Depends: libnvidia-compute-575 (= 575.57.08-0ubuntu2) 
but it is not going to be installed
                       Depends: libnvidia-extra-575 (= 575.57.08-0ubuntu2) but 
it is not going to be installed
                       Depends: nvidia-compute-utils-575 (= 575.57.08-0ubuntu2) 
but it is not going to be installed
                       Depends: libnvidia-decode-575 (= 575.57.08-0ubuntu2) but 
it is not going to be installed
                       Depends: libnvidia-encode-575 (= 575.57.08-0ubuntu2) but 
it is not going to be installed
                       Depends: nvidia-utils-575 (= 575.57.08-0ubuntu2) but it 
is not going to be installed
                       Depends: xserver-xorg-video-nvidia-575 (= 
575.57.08-0ubuntu2) but it is not going to be installed
                       Depends: libnvidia-cfg1-575 (= 575.57.08-0ubuntu2) but 
it is not going to be installed
                       Depends: libnvidia-fbc1-575 (= 575.57.08-0ubuntu2) but 
it is not going to be installed
                       Recommends: libnvidia-compute-575:i386 (= 
575.57.08-0ubuntu2)
                       Recommends: libnvidia-decode-575:i386 (= 
575.57.08-0ubuntu2)
                       Recommends: libnvidia-encode-575:i386 (= 
575.57.08-0ubuntu2)
                       Recommends: libnvidia-fbc1-575:i386 (= 
575.57.08-0ubuntu2)
                       Recommends: libnvidia-gl-575:i386 (= 575.57.08-0ubuntu2)
  Error: Unable to satisfy dependencies. Reached two conflicting decisions:
     1. nvidia-kernel-common-575:amd64=575.57.08-0ubuntu2 is not selected for 
install because:
        1. nvidia-driver-570:amd64 is selected for install
        2. nvidia-driver-570:amd64 Depends nvidia-kernel-common-570 (<= 
570.133.07-1) and Depends nvidia-kernel-common-570 (>= 570.133.07)
        3. nvidia-kernel-common-570:amd64 Conflicts nvidia-kernel-common
           [selected nvidia-kernel-common-570:amd64]
     2. nvidia-kernel-common-575:amd64=575.57.08-0ubuntu2 is selected for 
install because:
        1. nvidia-driver-575:amd64=575.57.08-0ubuntu2 is selected for install
        2. nvidia-driver-575:amd64=575.57.08-0ubuntu2 Depends 
nvidia-kernel-common-575 (>= 575.57.08)
        3. nvidia-kernel-common-575:amd64 is available in version 
575.57.08-0ubuntu2

  Apt *should* find the solution “remove all the nvidia-570 packages”
  and offer it.

  Oddly, after “apt remove nvidia-driver-570”:
  ```
  The following packages were automatically installed and are no longer 
required:
    libnvidia-cfg1-570    libnvidia-decode-570:i386    
libnvidia-encode-570:i386  libnvidia-fbc1-570:i386  nvidia-compute-utils-570    
    nvidia-kernel-common-570  nvidia-settings          
xserver-xorg-video-nvidia-570
    libnvidia-common-570  libnvidia-egl-wayland1:i386  libnvidia-extra-570      
  libnvidia-gl-570         nvidia-dkms-570                 
nvidia-kernel-source-570  nvidia-utils-570
    libnvidia-decode-570  libnvidia-encode-570         libnvidia-fbc1-570       
  libnvidia-gl-570:i386    nvidia-firmware-570-570.133.07  nvidia-prime         
     screen-resolution-extra
  Use 'sudo apt autoremove' to remove them.

  REMOVING:
    nvidia-driver-570

  Summary:
    Upgrading: 0, Installing: 0, Removing: 1, Not Upgrading: 0
    Freed space: 1,445 kB

  Continue? [Y/n]
  ```
  and “apt --purge autoremove”:
  ```
  REMOVING:
    libnvidia-cfg1-570*    libnvidia-decode-570:i386*    
libnvidia-encode-570:i386*  libnvidia-fbc1-570:i386*  nvidia-compute-utils-570* 
       nvidia-kernel-common-570*  nvidia-settings*          
xserver-xorg-video-nvidia-570*
    libnvidia-common-570*  libnvidia-egl-wayland1:i386*  libnvidia-extra-570*   
     libnvidia-gl-570*         nvidia-dkms-570*                 
nvidia-kernel-source-570*  nvidia-utils-570*
    libnvidia-decode-570*  libnvidia-encode-570*         libnvidia-fbc1-570*    
     libnvidia-gl-570:i386*    nvidia-firmware-570-570.133.07*  nvidia-prime*   
           screen-resolution-extra*

  Summary:
    Upgrading: 0, Installing: 0, Removing: 22, Not Upgrading: 0
    Freed space: 914 MB

  Continue? [Y/n]
  ```

  I *can* then install nvidia-driver-575 and it will remove 
libnvidia-compute-570:
  ```
  Installing:
    nvidia-driver-575

  Installing dependencies:
    libnvidia-cfg1-575     libnvidia-compute-575:i386  
libnvidia-egl-wayland1:i386  libnvidia-extra-575      libnvidia-gl-575          
nvidia-dkms-575                nvidia-kernel-source-575  nvidia-utils-575
    libnvidia-common-575   libnvidia-decode-575        libnvidia-encode-575     
    libnvidia-fbc1-575       libnvidia-gl-575:i386     
nvidia-firmware-575-575.57.08  nvidia-prime              screen-resolution-extra
    libnvidia-compute-575  libnvidia-decode-575:i386   
libnvidia-encode-575:i386    libnvidia-fbc1-575:i386  nvidia-compute-utils-575  
nvidia-kernel-common-575       nvidia-settings           
xserver-xorg-video-nvidia-575

  REMOVING:
    libnvidia-compute-570  libnvidia-compute-570:i386

  Summary:
    Upgrading: 0, Installing: 25, Removing: 2, Not Upgrading: 0
    Download size: 451 MB
    Space needed: 992 MB / 6,222 GB available

  Continue? [Y/n]
  ```

  Although this might be because libnvidia-compute-XXX has
  Provides/Conflicts/Replaces set up?

  ProblemType: Bug
  DistroRelease: Ubuntu 25.10
  Package: apt 3.1.2
  ProcVersionSignature: Ubuntu 6.14.0-15.15-generic 6.14.0
  Uname: Linux 6.14.0-15-generic x86_64
  NonfreeKernelModules: zfs nvidia_modeset nvidia
  ApportVersion: 2.33.0-0ubuntu1
  Architecture: amd64
  CasperMD5CheckResult: pass
  CurrentDesktop: ubuntu:GNOME
  Date: Fri Jun 20 14:18:39 2025
  InstallationDate: Installed on 2023-08-06 (684 days ago)
  InstallationMedia: Ubuntu 22.04.2 2023.07.13 LTS "bcachefs" (20230713)
  SourcePackage: apt
  UpgradeStatus: Upgraded to questing on 2025-05-21 (29 days ago)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apt/+bug/2115024/+subscriptions


-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to