[Bug 2091689] [NEW] purge_packages broken for package not in repository

Icecream95 2091689 at bugs.launchpad.net
Fri Dec 13 06:09:49 UTC 2024


Public bug reported:

The purge_packages function in curtin/distro.py calls into apt to do
purge and autoremove in sequence on the specified package.

However, if the package being removed is not in a repository (at least I
think that's what the trigger is?), then the purge will succeed but
autoremove will fail because it cannot find the package.

One case where this happens is the Ubuntu concept image for Snapdragon X
Elite[1], where installing from an image with an outdated kernel and
while connected to the internet gives this:


Running command ['unshare', '--fork', '--pid', '--mount-proc=/target/proc', '--', 'chroot', '/target', 'eatmydata', 'apt-get', '--quiet', '--assume-yes', '--option=Dpkg::options::=--force-unsafe-io', '--option=Dpkg::Options::=--force-confold', 'purge', 'linux-image-unsigned-6.11.0-32-qcom-x1e'] with allowed return codes [0] (capture=False)
...
Purging configuration files for linux-image-unsigned-6.11.0-32-qcom-x1e (6.11.0-32.32) ...


...so the purge was successful, but then


Running command ['unshare', '--fork', '--pid', '--mount-proc=/target/proc', '--', 'chroot', '/target', 'eatmydata', 'apt-get', '--quiet', '--assume-yes', '--option=Dpkg::options::=--force-unsafe-io', '--option=Dpkg::Options::=--force-confold', 'autoremove', 'linux-image-unsigned-6.11.0-32-qcom-x1e'] with allowed return codes [0] (capture=False)
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package linux-image-unsigned-6.11.0-32-qcom-x1e
E: Couldn't find any package by glob 'linux-image-unsigned-6.11.0-32-qcom-x1e'
E: Couldn't find any package by regex 'linux-image-unsigned-6.11.0-32-qcom-x1e'

...

curtin.util.ProcessExecutionError: Unexpected error while running
command.


[1]: https://discourse.ubuntu.com/t/ubuntu-24-10-concept-snapdragon-x-
elite/48800

** Affects: curtin
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to curtin.
https://bugs.launchpad.net/bugs/2091689

Title:
  purge_packages broken for package not in repository

Status in curtin:
  New

Bug description:
  The purge_packages function in curtin/distro.py calls into apt to do
  purge and autoremove in sequence on the specified package.

  However, if the package being removed is not in a repository (at least
  I think that's what the trigger is?), then the purge will succeed but
  autoremove will fail because it cannot find the package.

  One case where this happens is the Ubuntu concept image for Snapdragon
  X Elite[1], where installing from an image with an outdated kernel and
  while connected to the internet gives this:

  
  Running command ['unshare', '--fork', '--pid', '--mount-proc=/target/proc', '--', 'chroot', '/target', 'eatmydata', 'apt-get', '--quiet', '--assume-yes', '--option=Dpkg::options::=--force-unsafe-io', '--option=Dpkg::Options::=--force-confold', 'purge', 'linux-image-unsigned-6.11.0-32-qcom-x1e'] with allowed return codes [0] (capture=False)
  ...
  Purging configuration files for linux-image-unsigned-6.11.0-32-qcom-x1e (6.11.0-32.32) ...

  
  ...so the purge was successful, but then

  
  Running command ['unshare', '--fork', '--pid', '--mount-proc=/target/proc', '--', 'chroot', '/target', 'eatmydata', 'apt-get', '--quiet', '--assume-yes', '--option=Dpkg::options::=--force-unsafe-io', '--option=Dpkg::Options::=--force-confold', 'autoremove', 'linux-image-unsigned-6.11.0-32-qcom-x1e'] with allowed return codes [0] (capture=False)
  Reading package lists...
  Building dependency tree...
  Reading state information...
  E: Unable to locate package linux-image-unsigned-6.11.0-32-qcom-x1e
  E: Couldn't find any package by glob 'linux-image-unsigned-6.11.0-32-qcom-x1e'
  E: Couldn't find any package by regex 'linux-image-unsigned-6.11.0-32-qcom-x1e'

  ...

  curtin.util.ProcessExecutionError: Unexpected error while running
  command.


  [1]: https://discourse.ubuntu.com/t/ubuntu-24-10-concept-snapdragon-x-
  elite/48800

To manage notifications about this bug go to:
https://bugs.launchpad.net/curtin/+bug/2091689/+subscriptions




More information about the foundations-bugs mailing list