I often spin up a temporary Ubuntu environment to run one-shot commands, or quickly and interactively run parts of a Dockerfile, or even check some Ubuntu-specific man pages. And I often get the message This system has been minimized by removing packages.

Handwritten Lyrics

For example, if you try to check a man page in a base ubuntu:26.04 image, you get this message instead:

# man man
This system has been minimized by removing packages and content that are
not required on a system that users do not log into.

To restore this content, including manpages, you can run the 'unminimize'
command. You will still need to ensure the 'man-db' package is installed.

To unminimize the container:

# apt-get update
# apt-get install -y unminimize
# unminimize
This system has been minimized by removing packages and content that are
not required on a system that users do not log into.

This script restores content and packages that are found on a default
Ubuntu server system in order to make this system more suitable for
interactive use.

Reinstallation of packages may fail due to changes to the system
configuration, the presence of third-party packages, or for other
reasons.

This operation may take some time.

Would you like to continue? [y/N] y

It then installs a list of packages and their dependencies, which takes around 3 minutes with my internet connection.

This doubles the virtual image size:

$ docker ps --size --format "table {{.Image}}\t{{.Names}}\t{{.Size}}"
IMAGE                           NAMES        SIZE
docker.io/library/ubuntu:26.04  unminimized  137MB (virtual 248MB)
docker.io/library/ubuntu:26.04  base         11.4kB (virtual 112MB)

And when I need man pages, I also have to install man-db, which adds around 20 MB.

Here’s a one-liner for all of this: apt-get update && apt-get install -y unminimize man-db && yes | unminimize