- 问题背景
- 清理命令
- 命令参数
- 稳妥的清理命令
之前虚拟环境的默认目录设置在 /home/
下,导致 /home/
目录不堪重负,在修改了虚拟环境的默认路径之后,发现包环境目录下存在很多文件夹和解压之前的压缩包,占用了极大的空间,既然叫缓存目录,我便到网上了解了一下该目录能否删除。
conda clean -h
xxx@xxx-Desktop:~$ conda clean -h
usage: conda clean [-h] [-a] [-i] [-p] [-t] [-f]
[-c TEMPFILES [TEMPFILES ...]] [-d] [--json] [-q] [-v] [-y]
Remove unused packages and caches.
Options:
optional arguments:
-h, --help Show this help message and exit.
Removal Targets:
-a, --all Remove index cache, lock files, unused cache packages,
and tarballs.
-i, --index-cache Remove index cache.
-p, --packages Remove unused packages from writable package caches.
WARNING: This does not check for packages installed
using symlinks back to the package cache.
-t, --tarballs Remove cached package tarballs.
-f, --force-pkgs-dirs
Remove *all* writable package caches. This option is
not included with the --all flag. WARNING: This will
break environments with packages installed using
symlinks back to the package cache.
-c TEMPFILES [TEMPFILES ...], --tempfiles TEMPFILES [TEMPFILES ...]
Remove temporary files that could not be deleted
earlier due to being in-use. Argument is path(s) to
prefix(es) where files should be found and removed.
Output, Prompt, and Flow Control Options:
-d, --dry-run Only display what would have been done.
--json Report all output as json. Suitable for using conda
programmatically.
-q, --quiet Do not display progress bar.
-v, --verbose Can be used multiple times. Once for INFO, twice for
DEBUG, three times for TRACE.
-y, --yes Do not ask for confirmation.
Examples:
conda clean --tarballs
稳妥的清理命令
conda clean -p
:从可写包缓存中删除未使用的包。警告:这不会检查已安装的软件包使用符号链接返回包缓存。conda clean -t
:删除缓存的包 tarball。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)