Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

conda update conda does not update conda

I had some problems with anaconda, so I decided to uninstall and reinstall it. To do that I used anaconda-clean and ran the following command:

rm -rf ~/opt/anaconda3

The version that was installed is 4.12.0 and I wanted to update to the most recent, 22.9.0, but whenever I run

conda update conda

or

conda update -n base conda

and check the version

conda --version

I keep getting 4.12.0

Is there a way to solve this or find out if something went wrong when I deleted/installed anaconda?

like image 681
Lucre Avatar asked Sep 05 '25 03:09

Lucre


1 Answers

I had the same problem due to an old version of Python in base. Conda recommends against upgrading python in an environment, but for base I am not sure if there is a better option. In the end, the following did the trick (running in base):

conda install python=3.10 conda=23.5

From there you could run conda update --all for good measure.

Interestingly, we see a hint of why there might be problems in the run logs:

...
The following packages will be UPDATED:

  conda                               4.13.0-py38h06a4308_0 --> 23.5.0-py310h06a4308_0
  python                                  3.8.16-h7a1cb2a_3 --> 3.10.11-h7a1cb2a_2

The following packages will be DOWNGRADED:

  brotlipy                          0.7.0-py38h27cfd23_1003 --> 0.7.0-py310h7f8727e_1002
  certifi                           2023.5.7-py38h06a4308_0 --> 2023.5.7-py310h06a4308_0
  cffi                                1.15.1-py38h5eee18b_3 --> 1.15.1-py310h5eee18b_3
  conda-package-han~                   2.1.0-py38h06a4308_0 --> 1.9.0-py310h5eee18b_1
  cryptography                        39.0.1-py38h9ce1e76_0 --> 39.0.1-py310h9ce1e76_0
  idna                                   3.4-py38h06a4308_0 --> 3.4-py310h06a4308_0
  pip                                 23.0.1-py38h06a4308_0 --> 23.0.1-py310h06a4308_0
  pycosat                              0.6.4-py38h5eee18b_0 --> 0.6.4-py310h5eee18b_0
  pyopenssl                           23.0.0-py38h06a4308_0 --> 23.0.0-py310h06a4308_0
  pysocks                              1.7.1-py38h06a4308_0 --> 1.7.1-py310h06a4308_0
  requests                            2.29.0-py38h06a4308_0 --> 2.29.0-py310h06a4308_0
  setuptools                          67.8.0-py38h06a4308_0 --> 67.8.0-py310h06a4308_0
  urllib3                            1.26.15-py38h06a4308_0 --> 1.26.15-py310h06a4308_0
  wheel                               0.38.4-py38h06a4308_0 --> 0.38.4-py310h06a4308_0
...

Might be my misreading, but it seems like the conda versioning order is a bit messed up due to placing py37xxx, py38xxx, etc. after py310xxx, py311xxx, etc. by alphabetical rather than semantic ordering. So simply running update prefers not to "downgrade" these packages, unless you specifically request it.

like image 103
gkanwar Avatar answered Sep 07 '25 20:09

gkanwar