Skip to content

conda/conda-self

conda-self

Commands to manage your base environment safely.

conda self

Manage your conda 'base' environment safely.

$ conda self
usage: conda self [-V] [-h] {install,remove,reset,update} ...

Manage your conda 'base' environment safely.

options:
  -V, --version         Show the 'conda-self' version number and exit.
  -h, --help            Show this help message and exit.

subcommands:
  {install,remove,reset,update}
    install             Add conda plugins to the 'base' environment.
    remove              Remove conda plugins from the 'base' environment.
    reset               Reset 'base' environment to essential packages only.
    update              Update 'conda' and/or its plugins in the 'base' environment.

Custom channels

conda self install and conda self update use your configured channels. To install plugins from a custom channel (e.g. a company or community channel on anaconda.org or prefix.dev), add it to your configuration first:

conda config --add channels my-channel -n base
conda self install my-plugin

This keeps channel configuration consistent across install, update, and dependency resolution.

Inline channel specs (e.g. conda-forge::my-plugin) are not supported and will result in an error.

Base Environment Protection

To check if your base environment is protected, run:

conda doctor base-protection

To protect your base environment, run:

conda doctor base-protection --fix

This will:

  1. Clone your current base environment to a new "default" environment
  2. Reset base to essential packages only
  3. Freeze the base environment to prevent modifications

To see all available health checks, run:

conda doctor --list

Unprotecting base

To remove protection entirely, delete the frozen file:

rm $CONDA_PREFIX/conda-meta/frozen

To bypass protection for a single command, pass --override-frozen or set CONDA_OVERRIDE_FROZEN=1. To disable it permanently, add override_frozen: true to your .condarc.

Configuration

Permanent packages

By default, conda self reset keeps only conda, conda-self, and their plugins installed. To keep additional packages (and their dependencies) in the base environment, add them to the self_permanent_packages setting in your .condarc:

plugins:
  self_permanent_packages:
    - anaconda-anon-usage

Or use conda config:

conda config --add plugins.self_permanent_packages anaconda-anon-usage

Installation

  1. conda install -n base conda-self
  2. conda self --help

Contributing

See CONTRIBUTING.md

About

A self command for conda

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Contributors