[Bug 2036195] Re: Any packages installed in binary hooks are marked as manually installed - even dependencies

Timo Aaltonen 2036195 at bugs.launchpad.net
Fri Feb 2 14:33:26 UTC 2024


Hello Philip, or anyone else affected,

Accepted livecd-rootfs into focal-proposed. The package will build now
and be available at https://launchpad.net/ubuntu/+source/livecd-
rootfs/2.664.52 in a few hours, and then in the -proposed repository.

Please help us by testing this new package.  See
https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how
to enable and use -proposed.  Your feedback will aid us getting this
update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug,
mentioning the version of the package you tested, what testing has been
performed on the package and change the tag from verification-needed-
focal to verification-done-focal. If it does not fix the bug for you,
please add a comment stating that, and change the tag to verification-
failed-focal. In either case, without details of your testing we will
not be able to proceed.

Further information regarding the verification process can be found at
https://wiki.ubuntu.com/QATeam/PerformingSRUVerification .  Thank you in
advance for helping!

N.B. The updated package will be released to -updates after the bug(s)
fixed by this package have been verified and the package has been in
-proposed for a minimum of 7 days.

** Tags removed: verification-done verification-done-focal
** Tags added: verification-needed verification-needed-focal

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

Title:
  Any packages installed in binary hooks are marked as manually
  installed - even dependencies

Status in livecd-rootfs package in Ubuntu:
  Fix Released
Status in livecd-rootfs source package in Xenial:
  Fix Released
Status in livecd-rootfs source package in Bionic:
  Fix Released
Status in livecd-rootfs source package in Focal:
  Fix Committed
Status in livecd-rootfs source package in Jammy:
  Fix Released
Status in livecd-rootfs source package in Lunar:
  Fix Released

Bug description:
  After much debugging trying to understand why `apt-get autoremove` was
  not working in a binary hook I realised that all packages installed in
  a binary hook are marked as manually installed - even the dependencies
  of packages. This is a bug.

  Another side affect of this is that any dependency of a package in the
  base chroot that is removed in a binary hook is not autoremovable in
  the binary hook.

  It is autoremovable once the image is created and launched though.

  This is due to how the `setup_mountpoint` function works (see
  https://git.launchpad.net/livecd-rootfs/tree/live-
  build/functions#n123) specifically

  ```
  mount -t tmpfs none "$mountpoint/var/lib/apt"
  ```

  Which means that inside the chroot that the binary hook works on, the
  `/var/lib/apt` directory is empty... including the
  `/var/lib/apt/extended_states` file which is used to store whether a
  package was auto installed or not.

  The same goes the other way - any changes to the
  `/var/lib/apt/extended_states`  file inside chroot that the binary
  hook is changing are not reflected in the final image due to the
  `teardown_mountpoint` (see https://git.launchpad.net/livecd-
  rootfs/tree/live-build/functions#n152) not persisting any of those
  changes.

  The end result being.

  * If a package is removed in the binary hook then the resulting image will likely have autoremovable packages at first launch
  * Any package and their dependencies installed in a binary hook will all be marked as manually installed.

  SRU
  ====

  [ Impact ]

   * Packages installed in a binary hook are marked as manually
  installed - even the dependencies of packages

  [ Test Plan ]

   * Build test images and remove a package with dependencies. 
     * Confirm that the dependencies are marked as autoremovable.
     * Confirm there are packages marked as auto installed

  [ Where problems could occur ]

   * Is any dependent packages are not marked as autremovable. 
   * If no packages are marked as auto installed

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/livecd-rootfs/+bug/2036195/+subscriptions




More information about the foundations-bugs mailing list