Updating conda and Anaconda#

Follow the instructions below to update Anaconda to the latest version.

  • Windows: Open Anaconda Prompt.

  • macOS or Linux: Open a terminal window.

To update to the latest version of Anaconda, enter these commands:

# Update the conda package manager to the latest version in your base environment
conda update -n base conda
# Use conda to update Anaconda to the latest version in your base environment
conda update -n base anaconda

To update to a specific version of Anaconda, enter these commands:

# Update the conda package manager to the latest version in your base environment
conda update -n base conda
# Use conda to view a list of available Anaconda versions
conda search anaconda
# Use conda to install a specific version of Anaconda in your base environment
# Replace <VERSION_NUMBER> with the version of Anaconda you want to install
conda install -n base anaconda=<VERSION_NUMBER>

Note

If the version of conda you are updating to requires a new version of Python as a dependency, conda will update the python package in your base environment (along with any other dependency packages).

Updating the Anaconda metapackage to a specific version number#

conda install anaconda=<VERSION_NUMBER> grabs a specific release of the Anaconda metapackage (for example, conda install anaconda=2023.09). The Anaconda metapackage is a collection of all the packages available in the Anaconda installer. Each version is a locked collection of the packages available with the installer at the specific point in time when the version was released.

Note

Installing a different version of the Anaconda metapackage may remove packages if the new metapackage that is replacing your old one has removed packages. As of conda 4.7, when a package loses its connection to the set of specs that have been requested in the past, it gets removed.

See all of the available Anaconda versions.

The custom Anaconda metapackage#

There is a special “custom” version of the Anaconda metapackage that has all the package dependencies, but none of them are constrained. The “custom” version is lower in version ordering than any actual release number. To install the custom version, use conda install anaconda=custom.

Updating all packages in the Anaconda metapackage#

You can update all installed packages in a specific environment by using the --all tag.

# Replace <ENV-NAME> with the name of the environment you want to update
# You can only update one environment at a time
conda activate <ENV-NAME>
conda update --all

You can also specify the environment name in the update command:

# Replace <ENV-NAME> with the name of the environment you want to update
conda update -n <ENV-NAME> --all

Using the --all flag unpins all the packages in the current environment and updates them to the latest version, if possible. In doing so, conda drops all the version constraints from the environment’s history and tries to make everything as new as it can. This includes removing any packages that are orphaned by the update.

conda update --all may not be able to make every package the latest version because you may have conflicting constraints in your environment. With Anaconda 2019.07’s newer Anaconda metapackage, conda update --all installs the custom version of the metapackage in order to update other package specs.

Updating individual packages in the Anaconda metapackage#

When you use conda update <PACKAGE_NAME> or conda install <PACKAGE_NAME>, conda may not be able to update or install that package without changing something else you specified in the past.

In the case of the Anaconda metapackage, when you enter conda update ipython but you have Anaconda 2019.03 currently installed, conda can and should “downgrade” Anaconda to the custom version (the one without any dependency constraints) so that iPython can be updated.

When conda cannot fulfill the request for the latest package available, it usually means that newer packages exist for your spec but are in conflict. To force the change, try the following:

# Replace <PACKAGE_NAME> with the name of the package you want to update
# Replace <NEW_VERSION> with the version number you want to force install
conda install <PACKAGE_NAME>=<NEW_VERSION>