title: How to manually clean up conda in my home directory?
body: <p>I use Anaconda in my computer to handle my python versions and environments. The location of the Anaconda installation (and consequently the default location for newly created environments) is <code>/opt/anaconda3/</code>. I have two custom environments that I have created - <strong>envA</strong> and <strong>envB</strong>. <strong>envA</strong> is present in <code>/opt/anaconda3/envs/envA</code> and <strong>envB</strong> is in <code>~/.conda/envs/envB</code>. This is because I chose it that way -- <strong>envB</strong> is for some personal experiments and research and hence it made sense to create it in my home directory.</p>
  
  <p>Now, after some time, when the unused packages and caches occupied too much of my disk space, I ran a clean up by doing</p>
  
  <pre><code>conda clean --all
  </code></pre>
  
  <p>I observed that the above line cleaned up <em>only</em> the default directory at <code>/opt/anaconda3</code>, but not the one in my home directory. I have only one environment (<strong>envB</strong>) in my home directory and yet <code>~/.conda/envs/</code> occupies close to 6 GB of disk space so I am pretty sure <code>conda clean</code> had no effect on my home directory.</p>
  
  <p>Hence, I have two specific questions:</p>
  
  <ul>
  <li><p>Is there a way to make <code>conda clean</code> work on my home directory as well? I tried <code>conda clean &lt;dir&gt;</code> but that does not work.</p></li>
  <li><p>If I were delete unused packages and the caches manually, which directories/files do I delete within <code>~/.conda</code>? Here is a quick display of the directory structure.</p>
  
  <pre><code>~/.conda/
      -&gt; environments.txt
      -&gt; envs/
          -&gt; envB/
          -&gt; .pkgs/
      -&gt; pkgs/
  </code></pre></li>
  </ul>
  
  <p>I figured I should delete the contents of either <code>~/.conda/pkgs</code> or <code>~/.conda/envs/.pkgs</code>, because they both occupy most of the space. From what I have seen, <code>~/.conda/envs/.pkgs/</code> contains several obviously unnecessary packages (incl multiple versions) and <code>~/.conda/pkgs/</code> seems to contain the essential packages for my environment. But here's the catch -- <code>~/.conda/pkgs</code> contains only 27 package files, whereas <strong>envB</strong> has 43 packages in fact. So I think there may be some other packages in <code>~/.conda/envs/.pkgs</code> that may be linked or referenced.</p>
  
  <p>I have tried searching for the answer to this but could not find any answer, hence my decision to ask here as I am sure this would be helpful to many others too. Even the official conda documentation as well as github forum do not have any mention of this issue.</p>
  
  <p>Thanks much for the help!</p>