conda update conda — ran 4 days and exited what to do.

Ebeb
2 min readSep 12, 2023
Photo by Timothy Dykes on Unsplash

I was trying to update a very old conda version 4.7.12 to the latest and ran the command “conda update conda” as root on the base anaconda environment on Centos 7.9 linux. This is what happened.

Never run “pip install” and “conda install” on the same environment.

As everyone knows by now, you should never run “pip install” and “conda install” on the same conda environment as it will create all kinds of messy package conflicts. But since I had done this with few packages my conda base was messed up. First “conda update conda” gave a message that — The environment is inconsistent, please check the package plan carefully. The following packages are causing the inconsistency — it listed about 50 packages.

Now conda started solving the environment and found conflicts. For example:

`Finding shortest conflict path for lz4-c[version=’>=1.9.3,<1.10.0a0']: 100%`

conda went on solving for hours and hours. Then it kept running for days. Finally I let it run for 4 days and when I checked the next morning, it had exited but no error message or any clue why it ended. It just decided it was too tired after 4 days so just gave up I guess. Lot of the time was spent on blas and openblas package solving it seemed.

I tried to uninstall some packages installed using “pip uninstall” and “conda remove” but it still kept solving for hours and hours and fails eventually.

What should we do now? Since conda 4.7.12 is too old to use libmamba solver there is no way to speed it up.

I decided to uninstall the old anaconda and reinstall fresh new version.

Uninstalling Anaconda Distribution

When uninstalling Anaconda, you have two options: a full uninstall or a simple remove. A simple remove will leave a few files behind, which for most users is just fine.

Remove your entire Anaconda directory with rm -rf . Find the location of the anaconda install:

$ conda list anaconda

# packages in environment at /opt/anaconda3

$ conda info

active environment : base
active env location : /opt/anaconda3
user config file : /root/.condarc
conda version : 4.7.12
virtual packages :
base environment : /opt/anaconda3 (writable)
package cache : /opt/anaconda3/pkgs
/root/.conda/pkgs
envs directories : /opt/anaconda3/envs
/root/.conda/envs
platform : linux-64

Better to move the old Anaconda install folder to backup folder if you have disk space else delete the folder:

$ mv /opt/anaconda3 /opt/anaconda3.oldv5.3.1

Close and reopen your terminal to refresh it. You should no longer see (base) in your terminal prompt.

Now you can re-install Anaconda latest version fresh from the website https://docs.anaconda.com/free/anaconda/install/linux/

  • **END OF BLOG***

--

--