7.11. Cleanup

Remove temporary bootstrap artifacts and selected documentation so the target system does not carry unnecessary build leftovers.

Run context: execute these commands as root inside the chapter 7 chroot environment.

Scope: this step intentionally deletes transitional files and directories that were useful during the build but are not part of the intended runtime system layout.

At this point, the base utilities are installed and the temporary scaffolding can be trimmed. This cleanup keeps the final image smaller and avoids carrying artifacts that can confuse later builds.

Remove selected documentation directories

The following documentation paths are not kept in the target layout policy for this book:

Remove both directories now:

rm -rf /system/documentation/man-pages /system/documentation/xz

Remove libtool archive files from system libraries

Libtool archive files (*.la) are metadata files used primarily during some build/link workflows. They are not needed for the target runtime and can cause incorrect link decisions in some toolchains.

Remove them from /system/libraries:

find /system/libraries -type f -name '*.la' -exec rm -f -- '{}' ';'

Remove temporary tools tree

The /system/tools directory was useful during transitional build phases and is no longer required.

rm -rf /system/tools

Cleanup Result

After this step, the target system keeps only the paths intended for ongoing package work and runtime use, with temporary bootstrap content removed.

Command Explanations