LinuxCommandLibrary

conda-remove

Remove packages from Conda environment

TLDR

Remove scipy from the currently active environment

$ conda remove scipy
copy

Remove a list of packages from the specified environment
$ conda remove [[-n|--name]] [environment_name] [package1 package2 ...]
copy

Remove all packages and the environment itself
$ conda remove [[-n|--name]] [environment_name] --all
copy

Remove all packages, but keep the environment
$ conda remove [[-n|--name]] [environment_name] --all --keep-env
copy

SYNOPSIS

conda remove [options] package_name [package_name ...]

PARAMETERS

--all
    Remove all packages from the environment

-n, --name
    Name of environment to remove from

-p, --prefix
    Full path to environment

--revision REVISION
    Rollback environment to specified revision

--force
    Force removal without error if package missing

--no-deps
    Do not remove unused dependencies

--dry-run
    Show actions without executing

--json
    Output in JSON format

-q, --quiet
    Minimal output

--offline
    Offline mode, no network access

DESCRIPTION

The conda remove command is a key tool in the Conda package manager, used to uninstall packages from a specified or current environment. Conda, part of the Anaconda distribution, manages Python and other language packages across platforms, including Linux. When executed, conda remove identifies the target package(s) and removes them along with unused dependencies by default, ensuring environment consistency.

It prompts for confirmation unless suppressed and can target specific environments via --name or --prefix. This prevents accidental removal from the wrong environment. For complex setups, options like --revision allow rollback to previous states, aiding reproducible research.

Unlike system package managers like apt, Conda handles binary dependencies, isolating environments to avoid conflicts. Always use --dry-run first to preview changes. Removal is safe but irreversible without backups or revisions enabled.

CAVEATS

May break environments if dependencies not handled; use --dry-run. Prompts unless --yes used. Not for base environment lightly.

EXAMPLES

conda remove numpy
Removes numpy and unused deps.

conda remove -n myenv --all
Clears entire environment.

DEPENDENCIES

Conda removes only unused deps by default; use --no-deps to ignore.

HISTORY

Introduced in early Conda versions (~2012) by Continuum Analytics (now Anaconda). Evolved with multi-environment support in Conda 4.x+ for better reproducibility.

SEE ALSO

conda(1), conda list(1), conda install(1), pip uninstall(1)

Copied to clipboard