自制软件:错误:不应直接调用update-report


192

运行时,brew update我得到以下信息:

/usr/local/Library/brew.sh: line 32: /usr/local/Library/ENV/scm/git: No such file or directory
/usr/local/Library/brew.sh: line 32: /usr/local/Library/ENV/scm/git: No such file or directory
[etc..]
Error: update-report should not be called directly!

呼叫brew config报告以下内容:

HOMEBREW_VERSION: 0.9.9
ORIGIN: https://github.com/Homebrew/brew.git
HEAD: 90e84453f9adda65de6b9274987d06e46caa5d37
Last commit: 4 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 05ce2548bad01807c6be2aece21ab70d221755e6
Core tap last commit: 8 weeks ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_REPOSITORY: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://homebrew.bintray.com
CPU: quad-core 64-bit ivybridge
Homebrew Ruby: 2.0.0-p648
Clang: 7.3 build 703
Git: 2.7.0 => /usr/local/bin/git
Perl: /usr/bin/perl
Python: /Users/username/anaconda/bin/python => /Users/username/anaconda/bin/python2.7
Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
Java: 1.7.0_79, 1.6.0_65-b14-468
OS X: 10.11.4-x86_64
Xcode: 7.3
CLT: 7.3.0.0.1.1457485338
X11: 2.7.8 => /opt/X11

任何想法如何解决这个问题?我想知道Sophos Antivirus是否可能再次引起问题。


几周前,IIRC自制软件移动了文件。对我来说,它实际上需要/usr/local/Library/Homebrew/brew.sh-对我来说,/usr/local/Library/brew.sh已经不存在了。也许在过渡过程中出现了问题?
cel

Answers:


210

brew upgrade将升级所有已安装的软件包。如果您需要维护任何二进制文件的特定版本,请考虑使用@thanh-hải的答案:https ://stackoverflow.com/a/38464247/868724

我刚收到这个错误。我跑了brew upgrade,然后brew update又跑了,问题似乎解决了。

或者,尝试brew update按照@ ashley-willis的建议再次运行。


7
它将升级所有已安装的软件包。我有很多二进制文件,例如Apache Spark,对我来说看起来像是奇怪的解决方案
ololobus

2
cd /usr/local; git reset --hard origin/master; brew update意外帮助
ololobus '16

12
brew upgrade如果您的开发堆栈依赖于特定版本的软件包,则裸露是非常危险的(因为开发堆栈不会这样做)。它将所有软件包升级到最新版本,从而中断任何内容,具体取决于旧版本。强烈建议您避免使用此答案,并在下面使用@ThanhHải。
Peter H. Boling

2
请注意,这将更新所有已安装的软件包。
卡尔·G

...这将花费很长时间,并且(如果您使用的是OS X)会使您的笔记本电脑在重新编译所有brew应用程序时像疯了一样疯狂。
马特·安德鲁斯


62

编辑:运行 cd "$(brew --repository)" && git fetch && git reset --hard origin/master会解决!

请参阅https://github.com/Homebrew/brew/issues/557


12
实际上,这是比接受的答案更好的答案。它链接到跟踪器上的问题,并将在更多系统上工作。另外,对于brew v0.9.9上的OP错误,此答案对我也有用。同样,可接受的答案(带有裸露的内容brew upgrade)可能会破坏用户依赖的许多内容。盲目升级所有冲泡包装可能会导致灾难,可能需要数小时才能解决。@geotheory为-1,您还冲泡吗?
Peter H. Boling

@ PeterH.Boling对我来说效果很好,尽管其他答案是更好的选择。当有许多更好的解决方案可以执行相同的操作时,我不依赖我的日常驱动程序OS提供特定的软件包版本。
ntwrkguru

@ntwrkguru-我不关注。 brew(自制程序)不是操作系统的一部分,并且取决于在brew Universe中使用哪些工具来升级它们,对于开发环境而言可能是灾难性的。
Peter H. Boling

@ PeterH.Bowing我的意思是,对我来说,我不使用Mac上的任何东西,无论是通过brew,source还是Apple进行开发,所以我不在乎给定的brew包是什么版本。就这样。
ntwrkguru

0

我尝试过时遇到了同样的问题

brew tap homebrew/science
brew install opencv3
brew update

但是,键入

brew update

再次解决了我的问题。

Updated 2 taps (caskroom/cask, homebrew/core).
==> Cleaning up /Library/Caches/Homebrew...
Removing: /Library/Caches/Homebrew/ant-1.9.7.yosemite.bottle.tar.gz... (5.4MB)
Removing: /Library/Caches/Homebrew/cmake-3.2.1.yosemite.bottle.1.tar.gz... (10.4MB)
Removing: /Library/Caches/Homebrew/gecode-4.3.3.yosemite.bottle.tar.gz... (2.8MB)
Removing: /Library/Caches/Homebrew/leptonica-1.71_1.yosemite.bottle.tar.gz... (1.9MB)
Removing: /Library/Caches/Homebrew/libpng-1.6.16.yosemite.bottle.tar.gz... (431.8KB)
Removing: /Library/Caches/Homebrew/libtiff-4.0.3.yosemite.bottle.tar.gz... (1MB)
Removing: /Library/Caches/Homebrew/minizinc-1.6.tar.gz... (18.2MB)
Removing: /Library/Caches/Homebrew/pkg-config-0.28.yosemite.bottle.2.tar.gz... (220.1KB)
Removing: /Library/Caches/Homebrew/tesseract-3.02.02_3.yosemite.bottle.tar.gz... (19MB)
==> Migrating /Library/Caches/Homebrew to /Users/zenglinwang/Library/Caches/Homebrew...
==> Deleting /Library/Caches/Homebrew...
Warning: Failed to delete /Library/Caches/Homebrew.
Please do so manually.
==> New / Updated / Deleted Formulae
.................
==> Migrating HOMEBREW_REPOSITORY (please wait)...
==> Migrated HOMEBREW_REPOSITORY to /usr/local/Homebrew!
Homebrew no longer needs to have ownership of /usr/local. If you wish you can
return /usr/local to its default ownership with:
  sudo chown root:wheel /usr/local
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.