Ubuntu 16.04 LTS下Anaconda 2占用超5G,已用conda clean仍想精简?
Hey there! Let's tackle your questions about Anaconda 2's disk usage and cleanup step by step:
1. Is 5GB of disk usage normal?
Absolutely. Anaconda (especially the full distribution like Anaconda 2) comes pre-loaded with a huge suite of scientific computing, data analysis, and machine learning packages by default. This includes everything from NumPy and Pandas to matplotlib and scikit-learn, plus all their dependent libraries. A 5GB footprint is well within the expected range for a standard Anaconda installation—some setups even grow larger as you add more packages or create additional environments.
2. Can you free up space by deleting unnecessary folders?
Yes, definitely! While you've already used conda clean, here are more targeted steps to trim down the size:
- Remove unused environments: If you've created environments for old projects that you don't use anymore, delete them with:
Check all your environments first withconda env remove -n your_env_nameconda info --envs. - Verify thorough cache cleanup: Double-check you've run the most comprehensive clean command to wipe unused package caches, tarballs, and temporary files:
Theconda clean -apkgsfolder in your Anaconda directory is often a major source of bloat—this command clears out any packages not actively used by your environments. - Move personal data out of Anaconda's folder: If you've saved Jupyter notebooks, datasets, or other personal files inside the Anaconda installation directory, move them to your home folder or another storage location to reclaim space.
- Uninstall unused packages: List all packages in your base environment with
conda list, then remove any you never use with:conda remove package_name
3. How to check for duplicate installed modules?
Since you've already used conda clean, here's how to specifically hunt down duplicate packages:
- List duplicate packages directly: Run this command to see all packages with multiple versions installed in your current environment:
conda list --duplicates - Clean up duplicates automatically: If duplicates show up, you can remove older/unused versions with:
conda remove --duplicates - Check across environments: Repeat the
conda list --duplicatescommand in each of your environments to catch duplicates isolated to specific project setups. For packages installed in multiple environments that you don't need, consider removing them from unused environments or consolidating to a shared environment where possible.
内容的提问来源于stack exchange,提问作者Yunqiu Xu

