Your company here — click to reach over 10,000 unique daily visitors

image-minimizer - Man Page


image-minimizer — Utility script to remove files and packages


Brian C. Lane <bcl@redhat.com>

image-minimizer is a script used as an interpreter for kickstart %post sections. It is used to remove rpm packages and individual files from the system that Anaconda has just installed.

It processes a list of commands that tell it which files or rpms to remove, and which to keep.

Image-Minimizer Cmdline Arguments

usage: image-minimizer [-h] [-i STRING] [--dryrun] [-v] STRING

Optional arguments

-h,  --help

show this help message and exit

-i STRING--installroot STRING

Root path to prepend to all file patterns and installation root for RPM operations. Defaults to INSTALL_ROOT or /mnt/sysimage/


If set, no filesystem changes are made.

-v,  --verbose

Display every action as it is performed.

Positional arguments


Filename to process


You cannot pass any arguments to image-minimizer when using it from the kickstart %post.

When using this from a kickstart the image-minimizer package needs to be available. It is not included on the standard boot.iso, so you will need to include lorax in the %package section. You can use image-minimizer to remove lorax from the install.

If you are using this with livemedia-creator it can be installed on the host system so that lorax isn't needed in the %package list, and it doesn't need to be removed.


Commands are listed one per line, followed by a space, and then by the package, file, or glob.  The globs used are Unix style pathname patterns using *, ?, and [] character ranges. globbing is implemented using the python glob module.


Example Anaconda %post usage:

%post --interpreter=image-minimizer --nochroot

drop /lib/modules/*/kernel/fs
keep /lib/modules/*/kernel/fs/ext*
keep /lib/modules/*/kernel/fs/mbcache*
keep /lib/modules/*/kernel/fs/squashfs

droprpm make
droprpm mtools
droprpm mysql-libs
droprpm perl
droprpm perl-Pod-*
droprpm syslinux
keeprpm perl-Pod-Simple

# Not needed after image-minimizer is done
droprpm lorax



Weldr Team


Feb 07, 2024 40.5 Lorax