如何强制重新安装 Homebrew 软件包

问题描述 投票:0回答:1

在忽略了几个月后,我正在运行更新/升级到 Homebrew。我在处理包裹时遇到问题。

第一次尝试

brew update
(所有这些都是部分日志):

==> Migrating cask git-credential-manager-core to git-credential-
Error: inreplace failed
/opt/homebrew/Caskroom/git-credential-manager/.metadata/2.0.785/20221103154004.876/Casks/git-credential-manager.rb:
expected replacement of /\A\s*cask\s+"git\-credential\-manager\-core"/ with "cask \"git-credential-manager\""

然后

brew upgrade
:

==> Upgrading 1 outdated package:
git-credential-manager 2.0.785 -> 2.5.1
==> Upgrading git-credential-manager-core
==> Downloading https://github.com/git-ecosystem/git-credential-manager/releases
==> Downloading from https://objects.githubusercontent.com/github-production-rel
######################################################################### 100.0%
==> Running uninstall script /opt/homebrew/share/gcm-core/uninstall.sh
==> Purging files for version 2.5.1 of Cask git-credential-manager
Error: git-credential-manager: uninstall script /opt/homebrew/share/gcm-core/uninstall.sh does not exist.

后来做了(完整日志):

CTMacUser ~ % brew uninstall git-credential-manager-core
Warning: Formula microsoft/git/git-credential-manager-core was renamed to homebrew/cask/git-credential-manager.
Warning: Cask microsoft/git/git-credential-manager-core was renamed to git-credential-manager.
==> Uninstalling Cask git-credential-manager-core
==> Running uninstall script /opt/homebrew/share/gcm-core/uninstall.sh
Error: uninstall script /opt/homebrew/share/gcm-core/uninstall.sh does not exist.
CTMacUser ~ % brew uninstall git-credential-manager     
==> Uninstalling Cask git-credential-manager-core
==> Running uninstall script /opt/homebrew/share/gcm-core/uninstall.sh
Error: uninstall script /opt/homebrew/share/gcm-core/uninstall.sh does not exist.

如何删除卸载例程已损坏的东西? (然后我可以重新安装。)

macos homebrew uninstallation
1个回答
0
投票

您可以使用它进行清理和重新安装:

brew uninstall --ignore-dependencies <package_name>
brew install <package_name>

如果你想强制重新安装所有过时的软件包,你可以使用:

brew upgrade --force-bottle
© www.soinside.com 2019 - 2024. All rights reserved.