为什么 brew cleanup 或 brew cleanup -n 不显示任何输出?
Why does brew cleanup or brew cleanup -n don't show any output?
我很想清除我设备上的任何自制软件更新或版本副本,然后我认为用于该操作的命令是
brew cleanup
如果我想检查它会清除多少存储空间,命令是
brew cleanup -n
brew cleanup --dry-run
None 它们似乎对我有用,我想清除我计算机上任何多余的无用 Homebrew 副本。
另外,有没有可能它确实发生了但没有显示任何输出?
这是输出:
temp@Apples-MacBook-Pro ~ % brew cleanup -n
temp@Apples-MacBook-Pro ~ % brew cleanup
temp@Apples-MacBook-Pro ~ %
我所需要的只是一些输出,显示当我运行命令时可以清除/清除了多少space。
有没有可能因为我昨天才安装了 home-brew,所以没有什么可删除的,因此有这个输出?
这可能是因为没有什么可以清理的(尤其是如果你只用了 1 天的 Homebrew)。
我不确定你所说的“我想清除我电脑中任何多余的无用自制软件副本。”是什么意思,因为那不是 brew cleanup
是为了。它用于删除 Homebrew 在 brew install
期间下载的旧文件和未使用的文件。它 不是 用于清除旧版本的 Homebrew(当您执行 brew update
时会自动完成)。
~$ brew cleanup --help
Usage: brew cleanup [options] [formula|cask]
Remove stale lock files and outdated downloads for all formulae and casks, and
remove old versions of installed formulae. If arguments are specified, only do
this for the given formulae and casks. Removes all downloads more than 120 days
old. This can be adjusted with HOMEBREW_CLEANUP_MAX_AGE_DAYS.
--prune Remove all cache files older than specified
days.
-n, --dry-run Show what would be removed, but do not
actually remove anything.
-s Scrub the cache, including downloads for
even the latest versions. Note downloads
for any installed formulae or casks will
still not be deleted. If you want to delete
those too: rm -rf "$(brew --cache)"
--prune-prefix Only prune the symlinks and directories
from the prefix and remove no other files.
注意“删除超过 120 天的所有下载
old.”。如果你没有用 Homebrew 安装那么多东西 and/or 你已经很长时间没有使用它了,那么预计没有什么可以清理的。另外,即使使用 -s
选项,Homebrew 不会删除“任何已安装的配方或桶”的文件。
尝试安装和卸载一些东西,然后执行 brew cleanup
:
~$ brew install grep amazon-ecs-cli iterm2
...
~$ brew cleanup -s -n
~$
~$ brew uninstall grep amazon-ecs-cli iterm2
Uninstalling /usr/local/Cellar/grep/3.6... (21 files, 964.6KB)
Uninstalling /usr/local/Cellar/amazon-ecs-cli/1.21.0... (7 files, 46.2MB)
==> Uninstalling Cask iterm2
==> Backing App 'iTerm.app' up to '/usr/local/Caskroom/iterm2/3.4.3/iTerm.app'.
==> Removing App '/Applications/iTerm.app'.
==> Purging files for version 3.4.3 of Cask iterm2
~$ brew cleanup -s -n
Would remove: /Users/me/Library/Caches/Homebrew/amazon-ecs-cli--1.21.0.catalina.bottle.tar.gz (14.8MB)
Would remove: /Users/me/Library/Caches/Homebrew/grep--3.6.catalina.bottle.tar.gz (330.8KB)
Would remove: /Users/me/Library/Caches/Homebrew/Cask/iterm2--3.4.3.zip (21.3MB)
==> This operation would free approximately 36.4MB of disk space.
请注意,在安装这些公式时执行 brew cleanup
,它不会显示任何输出。只有当它们被卸载时,它才成为可以清理的东西。
或尝试传入 --prune=1
选项(删除所有超过 1 天的缓存文件)和 -s
选项(清理缓存,即使是最新版本)。在我使用 Homebrew 多年的系统上:
~$ brew cleanup --prune=1 -s -n
...
==> This operation would free approximately 1.1GB of disk space.
我很想清除我设备上的任何自制软件更新或版本副本,然后我认为用于该操作的命令是
brew cleanup
如果我想检查它会清除多少存储空间,命令是
brew cleanup -n
brew cleanup --dry-run
None 它们似乎对我有用,我想清除我计算机上任何多余的无用 Homebrew 副本。
另外,有没有可能它确实发生了但没有显示任何输出?
这是输出:
temp@Apples-MacBook-Pro ~ % brew cleanup -n
temp@Apples-MacBook-Pro ~ % brew cleanup
temp@Apples-MacBook-Pro ~ %
我所需要的只是一些输出,显示当我运行命令时可以清除/清除了多少space。
有没有可能因为我昨天才安装了 home-brew,所以没有什么可删除的,因此有这个输出?
这可能是因为没有什么可以清理的(尤其是如果你只用了 1 天的 Homebrew)。
我不确定你所说的“我想清除我电脑中任何多余的无用自制软件副本。”是什么意思,因为那不是 brew cleanup
是为了。它用于删除 Homebrew 在 brew install
期间下载的旧文件和未使用的文件。它 不是 用于清除旧版本的 Homebrew(当您执行 brew update
时会自动完成)。
~$ brew cleanup --help
Usage: brew cleanup [options] [formula|cask]
Remove stale lock files and outdated downloads for all formulae and casks, and
remove old versions of installed formulae. If arguments are specified, only do
this for the given formulae and casks. Removes all downloads more than 120 days
old. This can be adjusted with HOMEBREW_CLEANUP_MAX_AGE_DAYS.
--prune Remove all cache files older than specified
days.
-n, --dry-run Show what would be removed, but do not
actually remove anything.
-s Scrub the cache, including downloads for
even the latest versions. Note downloads
for any installed formulae or casks will
still not be deleted. If you want to delete
those too: rm -rf "$(brew --cache)"
--prune-prefix Only prune the symlinks and directories
from the prefix and remove no other files.
注意“删除超过 120 天的所有下载
old.”。如果你没有用 Homebrew 安装那么多东西 and/or 你已经很长时间没有使用它了,那么预计没有什么可以清理的。另外,即使使用 -s
选项,Homebrew 不会删除“任何已安装的配方或桶”的文件。
尝试安装和卸载一些东西,然后执行 brew cleanup
:
~$ brew install grep amazon-ecs-cli iterm2
...
~$ brew cleanup -s -n
~$
~$ brew uninstall grep amazon-ecs-cli iterm2
Uninstalling /usr/local/Cellar/grep/3.6... (21 files, 964.6KB)
Uninstalling /usr/local/Cellar/amazon-ecs-cli/1.21.0... (7 files, 46.2MB)
==> Uninstalling Cask iterm2
==> Backing App 'iTerm.app' up to '/usr/local/Caskroom/iterm2/3.4.3/iTerm.app'.
==> Removing App '/Applications/iTerm.app'.
==> Purging files for version 3.4.3 of Cask iterm2
~$ brew cleanup -s -n
Would remove: /Users/me/Library/Caches/Homebrew/amazon-ecs-cli--1.21.0.catalina.bottle.tar.gz (14.8MB)
Would remove: /Users/me/Library/Caches/Homebrew/grep--3.6.catalina.bottle.tar.gz (330.8KB)
Would remove: /Users/me/Library/Caches/Homebrew/Cask/iterm2--3.4.3.zip (21.3MB)
==> This operation would free approximately 36.4MB of disk space.
请注意,在安装这些公式时执行 brew cleanup
,它不会显示任何输出。只有当它们被卸载时,它才成为可以清理的东西。
或尝试传入 --prune=1
选项(删除所有超过 1 天的缓存文件)和 -s
选项(清理缓存,即使是最新版本)。在我使用 Homebrew 多年的系统上:
~$ brew cleanup --prune=1 -s -n
...
==> This operation would free approximately 1.1GB of disk space.