LinuxCommandLibrary

distrobox-rm

Remove a distrobox container

TLDR

Remove a Distrobox container (Tip: Stop the container before removing it)

$ distrobox-rm [container_name]
copy

Remove a Distrobox container forcefully
$ distrobox-rm [container_name] [[-f|--force]]
copy

SYNOPSIS

distrobox-rm [-f|--force] [--rm-distdir] [-v|--verbose] [--help] [--version] CONTAINER

PARAMETERS

-f, --force
    Force removal without confirmation prompt

--rm-distdir
    Also delete the container's distdir (user data directory)

-v, --verbose
    Enable verbose output for debugging

--help
    Display help message and exit

--version
    Display version information and exit

DESCRIPTION

Distrobox-rm is a utility from the Distrobox toolkit for deleting containers created with distrobox-create. Distrobox enables seamless integration of containerized Linux distributions into the host system, allowing users to install software from foreign distros without affecting the host.

Executing distrobox-rm CONTAINER stops the container if running, then removes it using the underlying container engine (Podman or Docker). By default, it preserves the container image for reuse and the persistent ~/.local/share/distrobox/CONTAINER directory (distdir), which holds user home data, installed packages, and exported applications. This ensures data safety during cleanup.

For complete removal, combine with --rm-distdir to delete the distdir too. The --force flag skips confirmation prompts, useful in scripts. Verbose mode aids debugging.

This command is crucial for disk management, as unused containers and images can accumulate. Always list containers with distrobox list first. Note that removing a container unexports any integrated apps, requiring re-export post-recreation. Distrobox-rm handles only Distrobox-named containers, not arbitrary ones.

CAVEATS

Container must exist and be named via distrobox list; stops running containers automatically but preserves images unless manually pruned. Data loss risk with --rm-distdir; unexports integrated apps.

EXAMPLES

distrobox-rm ubuntu-22.04
Removes the ubuntu-22.04 container (prompts for confirmation).

distrobox-rm -f --rm-distdir fedora
Forcibly deletes fedora container and all its data.

HISTORY

Part of Distrobox, developed by Luca Weiss (89luca89) since early 2021. Initial release integrated container management; distrobox-rm evolved to support Podman/Docker backends with distdir persistence added in v1.2+ for safer cleanups.

SEE ALSO

Copied to clipboard