Why did mamba keep older version of package's files in /pkgs directory upon update to newer version?

46 views Asked by At

I updated a python package using mamba to a newer version, but I found it kept the files of the older version in the mamabforge/pkgs directory. Why would it do this and what is the proper way to update packages so it completely removes the older version?

I was updating the libcurl package from 8.2.1 to 8.5.0 on the base mamba environment (yeah, I know altering the base environment is dumb, but I didn't set up this server in the first place and wouldn't have done it this way if I had a choice).

mamba update libcurl (the solver came up with upgrading to 8.5.0)

After updating the package, when I run mamba list I see libcurl 8.5.0 listed (and not 8.2.1). When I navigate to /opt/mambaforge/pkgs/ and list the files in the directory, I see these directories/files listed for libcurl:

libcurl-8.2.1-hca28451_0
libcurl-8.2.1-hca28451_0.conda
libcurl-8.5.0-hca28451_0
libcurl-8.5.0-hca28451_0.conda

Can I safely delete the libcurl-8.2.1 related directory and .conda file? How do I clean this up?

1

There are 1 answers

0
MKF On

In viewing this stackoverflow question related to conda, I realized that old package files stick around unless you clean them out as the pkgs directory is simply a cache. To do this in mamba, I ran this command:

mamba clean --all

I then navigated to my pkgs directory and listed the contents to see that the old package files and all tarballs were removed. Note that the --all flag will clean unused packages, tarballs (.conda), lock files, and index cache. If you do not want to remove all of those things, you may want to use a different flag.