Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run 'brew update' #1093

Open
Minmus74 opened this issue Mar 11, 2024 · 6 comments
Open

Unable to run 'brew update' #1093

Minmus74 opened this issue Mar 11, 2024 · 6 comments

Comments

@Minmus74
Copy link

j****-m*****-power-mac-g4:~ jmont$ brew doctor
Please note that these warnings are just used to help the Tigerbrew maintainers
with debugging if you file an issue. If everything you use Tigerbrew for is
working fine: please don't worry and just ignore them. Thanks!

Warning: Your Tigerbrew is outdated.
You haven't updated for at least 24 hours. This is a long time in brewland!
To update Tigerbrew, run brew update.
j******-m*****-power-mac-g4:~ jmont$ brew update
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint:
hint: git config --global init.defaultBranch
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint: git branch -m
Initialized empty Git repository in /usr/local/.git/
fatal: not in a git directory
Error: Failure while executing: git config core.autocrlf false
j****-m*****-power-mac-g4:~ jmont$ brew install git
Warning: git-2.43.0 already installed
j*****-m*****-power-mac-g4:~ jmont$ brew config
HOMEBREW_VERSION: 0.9.5
ORIGIN: (none)
HEAD: (none)
Last commit: never
HOMEBREW_PREFIX: /usr/local
HOMEBREW_REPOSITORY: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://ia904500.us.archive.org/24/items/tigerbrew
CPU: dual-core 32-bit g4e
OS X: 10.4.11-Power Macintosh
Curl: /usr/local/Library/Homebrew/vendor/portable-curl/current/bin/curl
Xcode: 2.5
CLT: N/A
GCC-4.0: build 5370
Clang: N/A
X11: N/A
System Ruby: 2.3.3-222 => /usr/local/Library/Homebrew/vendor/portable-ruby/2.3.3/bin/ruby
Perl: /usr/bin/perl
Python: /usr/bin/python => /System/Library/Frameworks/Python.framework/Versions/2.3/bin/python
Ruby: /usr/bin/ruby => /Users/jmont
Java: N/A

I didn't get far in the setup process before I encountered this error. I did have macports installed previously, but I followed their documentation to completely remove it off of my system. Let me know if I can provide anything else to help figure this out!

@noe
Copy link
Contributor

noe commented Apr 4, 2024

I have the same error and I don't have macports.

@noe
Copy link
Contributor

noe commented Apr 5, 2024

After checking what the installation script does, I conclude that git does not like having a repository at /usr/bin, because the invocation to git remote add origin https://github.com/mistydemeo/tigerbrew fails with error:

fatal: detected dubious ownership in repository at '/usr/local'

Nevertheless, it suggests a possible solution:

To add an exception for this directory, call:
      git config --global --add safe.directory /usr/local

After doing as git suggested, I can successfully execute brew update.

@sevan
Copy link
Contributor

sevan commented Apr 5, 2024

After checking what the installation script does, I conclude that git does not like having a repository at /usr/bin, because the invocation to git remote add origin https://github.com/mistydemeo/tigerbrew fails with error:

fatal: detected dubious ownership in repository at '/usr/local'

Makes sense. Permissions checking on directories was tightened up in git a couple of years ago & since /usr/local is made group writable, it trips git up. One way around out it would be to not make the directory group writeable, with the group set to the user who invoked the install script, but to make the user the owner. I think it's easier just to add the exception unless you're in a multi-user environment with untrusted users in which case you have bigger problem on your hands as you're running an ancient unpatched OS ;-)

@edevaldo
Copy link

edevaldo commented Apr 6, 2024

This was preventing me from doing a fresh install of Tigerbrew on a fresh installation of 10.4.11.
After:

git config --global --add safe.directory /usr/local
I was able to invoke "brew update".

@rdustinb
Copy link
Contributor

To add an exception for this directory, call:
git config --global --add safe.directory /usr/local


After doing as git suggested, I can successfully execute `brew update`.

This works for me as well. iMac G4 PowerPC, 10.5.8 with a fresh install of Tigerbrew. Thank you!

@jupo42
Copy link
Contributor

jupo42 commented Sep 13, 2024

I had a new install a few months ago on my G5 with 10.5 that had this same issue, and this solves it.

This also appears to be what Homebrew's postinstall script now does to solve this as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants