[solved] Removing packages from self-built image?

For the longest time, I have used openvpn and built in the necessary packages via the imagebuilder. Now that I am migrating to wireguard, how can I get rid of unwanted packages?

I am aware that removing them will not immediately free up the space since they live in /rom but would this at least be enough the prevent them from being included when the next point release comes along? That would be more than enough for me.

Or would I have to bake a new image right now, deselecting unwanted packages, to be sure?

You are correct that you cannot actually delete the packages from your current image's rom (they'll still be physically stored there), although deleting it will make it appear to be gone. Keep in mind that "deleting" packages from rom actually consumes extra space because a file needs to be created to mark the package as 'deleted'.

If you're using OWUT/ASU, you can actually remove the package when you go to request a new build. Make sure you have "advanced mode" turned on in the configuration. When you check for an upgrade, you'll see a list of all your packages and you can remove the ones you don't need.

You can do that at any time, of course.

yeah, I worried about forgetting to remove them :smiley:
(I'll make a list of packages to be excluded in my checklist for upgrades)

Perhaps a more long-term solution would be to keep a short recipe of added top-level packages, and always create a new image based on that. (There are changes to dependencies, so the full list of current packages will accumulate some crust.)

I have been doing that with full toolchain and image builder for years.
Examples
Full toolchain:

Imagebuilder:

(With both buildtools you can also negate defaults, like I add openssl variants and remove mbedtls variants.)

It's the dependencies that will not be listed nor deleted.

It's the next best thing to starting over though.

Site note. If you need to bump just a single package version or changing compile defaults it's also good to know that you can build the image builder and all wanted packages as optional modules.
So afterwards you just curate your final distribution without the need of compiling everything again just because you modified which packages has to be included or explicit excluded from the final firmware file...