From: "'Jan Kiszka' via isar-users" <isar-users@googlegroups.com>
To: Felix Moessbauer <felix.moessbauer@siemens.com>,
isar-users@googlegroups.com
Cc: christoph.steiger@siemens.com
Subject: Re: [PATCH 1/1] remove all newly installed packages after localepurge
Date: Mon, 23 Mar 2026 12:09:08 +0100 [thread overview]
Message-ID: <a50f3c53-5bde-4684-a32a-e3369cc8e63b@siemens.com> (raw)
In-Reply-To: <20260323094521.682576-1-felix.moessbauer@siemens.com>
On 23.03.26 10:45, 'Felix Moessbauer' via isar-users wrote:
> To perform the localepurge, we install the localepurge package, run the
> command and then remove it again from the rootfs. In case the set of
> newly installed packages intersects with the set of suggested packages
> from all previously installed packages, the intersection is not removed
> on autopurge (as apt internally does not track why a package was
> installed). However, we want these packages to be removed, as we never
> intended to install them in the first place (except for the localepurge
> operation).
>
> We fix this by tracking which new packages will be installed when
> installing localepurge and then remove exactly these.
>
> One example package that is affected in the base image is "perl".
>
> Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
> ---
> meta/classes-recipe/image-locales-extension.bbclass | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/meta/classes-recipe/image-locales-extension.bbclass b/meta/classes-recipe/image-locales-extension.bbclass
> index b6b07dba..45dcdb67 100644
> --- a/meta/classes-recipe/image-locales-extension.bbclass
> +++ b/meta/classes-recipe/image-locales-extension.bbclass
> @@ -69,6 +69,9 @@ __EOF__
> else
> localepurge_state='p'
> echo 'localepurge was not installed (removing it later)'
> + # track additional packages that will be installed, as these packages might be
> + # in the suggested set of other packages and by that need to be explicitly removed
> + localepurge_pkgs=$(chroot '${ROOTFSDIR}' apt-get ${ROOTFS_APT_ARGS} -s localepurge 2>&1 | sed -n 's/^Inst \([^ ]*\) .*/\1/p')
> chroot '${ROOTFSDIR}' apt-get ${ROOTFS_APT_ARGS} localepurge
> fi
>
> @@ -105,7 +108,7 @@ EOSH
> if [ "$localepurge_state" = 'p' ]
> then
> echo removing localepurge...
> - chroot '${ROOTFSDIR}' apt-get autopurge --yes localepurge
> + chroot '${ROOTFSDIR}' apt-get purge --yes $localepurge_pkgs
> fi
> EOSUDO
> }
Ah, nice. I recall having seen this inconsistency before but was too
lazy to fix it...
Jan
--
Siemens AG, Foundational Technologies
Linux Expert Center
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/a50f3c53-5bde-4684-a32a-e3369cc8e63b%40siemens.com.
next prev parent reply other threads:[~2026-03-23 11:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-23 9:45 'Felix Moessbauer' via isar-users
2026-03-23 11:09 ` 'Jan Kiszka' via isar-users [this message]
2026-03-26 13:05 ` Zhihang Wei
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a50f3c53-5bde-4684-a32a-e3369cc8e63b@siemens.com \
--to=isar-users@googlegroups.com \
--cc=christoph.steiger@siemens.com \
--cc=felix.moessbauer@siemens.com \
--cc=jan.kiszka@siemens.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox