ubuntu-minimal does not run autoremove

Bug #2012406 reported by Michael Johnson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
diskimage-builder
Fix Released
High
Michael Johnson

Bug Description

At the end of an image build using the "ubuntu-minimal" target "autoremove" is not run because the task is only in the "ubuntu" target. This can leave "build" package dependencies in the image such as gcc. We should move the 99-autoremove task into the ubuntu-common target so that both will run this task and remove dependencies that are no longer required.

For example in an Octavia amphora image build log:
2023-03-20 17:00:14.816 | > The following packages were automatically installed and are no longer required:
2023-03-20 17:00:14.816 | > cpp cpp-11 cpp-12 dctrl-tools gcc-11-base libasan6 libasan8 libatomic1
2023-03-20 17:00:14.816 | > libc-dev-bin libc6-dev libcc1-0 libcrypt-dev libexpat1-dev libgcc-11-dev
2023-03-20 17:00:14.816 | > libgcc-12-dev libgomp1 libisl23 libitm1 libjs-jquery libjs-sphinxdoc
2023-03-20 17:00:14.816 | > libjs-underscore liblsan0 libmpc3 libnsl-dev libpython3-dev libpython3.10
2023-03-20 17:00:14.816 | > libpython3.10-dev libquadmath0 libstdc++-11-dev libtirpc-dev libtsan0
2023-03-20 17:00:14.816 | > libtsan2 libubsan1 linux-libc-dev lto-disabled-list make patch
2023-03-20 17:00:14.816 | > python3.10-dev rpcsvc-proto zlib1g-dev
2023-03-20 17:00:14.816 | > Use 'sudo apt autoremove' to remove them.

This leaves about 1GB of unneeded packages in the image.

Changed in diskimage-builder:
assignee: nobody → Michael Johnson (johnsom)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to diskimage-builder (master)
Changed in diskimage-builder:
status: New → In Progress
Changed in diskimage-builder:
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to diskimage-builder (master)

Reviewed: https://review.opendev.org/c/openstack/diskimage-builder/+/878089
Committed: https://opendev.org/openstack/diskimage-builder/commit/45544d50385b19093f6e9f916ee184c7b11c8f38
Submitter: "Zuul (22348)"
Branch: master

commit 45544d50385b19093f6e9f916ee184c7b11c8f38
Author: Michael Johnson <email address hidden>
Date: Tue Mar 21 15:16:10 2023 +0000

    Fix ubuntu-minimal to run autoremove

    The "ubuntu" target had a post-install 99-autoremove task that removed
    unnecessary dependency packages, but the "ubuntu-minimal" target does not.
    This patch moves the 99-autoremove post-install task from the "ubuntu" target
    to the "ubuntu-common" target so that both will run an autoremove at the end of
    the image build.
    For the Octavia amphora image, this saved about 1GB in the image by removing
    build only package dependencies.

    Closes-Bug: #2012406
    Change-Id: I4592e3bd502045fa89203c075d3ea8f632e77177

Changed in diskimage-builder:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.