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

Warn if Homebrew files are currently owned by another user #84

Open
Aryanvkl opened this issue Dec 12, 2024 · 7 comments
Open

Warn if Homebrew files are currently owned by another user #84

Aryanvkl opened this issue Dec 12, 2024 · 7 comments

Comments

@Aryanvkl
Copy link

I attempted to setup strap and it failed to update Homebrew with the error Can't Create 'brew update'.

@werebus
Copy link
Member

werebus commented Dec 12, 2024

Hey @Aryanvkl, can you provide a bit more information? At the very least, the output of your strap.sh run - I might also ask for the --debug output.

I suspect that the issue here is that you are taking over someone else's laptop that is already mostly set up. But Homebrew operates on the assumption that your laptop only has one admin-ish user and that one user (in this case the old owner of your laptop) is the owner of the Homebrew install.

@Aryanvkl
Copy link
Author

Of course.

Updating Homebrew: Error: Can't create brew update lock in /usr/local/var/homebrew/locks!
Fix permissions by running:
sudo chown -R avakil-af /usr/local/var/homebrew
!!! Updating Homebrew: FAILED
!!! Run '/Users/avakil-af/Downloads/strap.sh --debug' for debugging output.
!!! If you're stuck: file an issue with debugging output at:
!!! https://github.com/umts/strap/issues/new

@werebus
Copy link
Member

werebus commented Dec 12, 2024

Yeah, I'm feeling better about my hypothesis. Can you tell me what brew doctor outputs?

@Aryanvkl
Copy link
Author

Sure. Its the following:

Error: Can't create brew vendor-install ruby lock in /usr/local/var/homebrew/locks!
Fix permissions by running:
sudo chown -R avakil-af /usr/local/var/homebrew
Error: Failed to upgrade Homebrew Portable Ruby!

@werebus
Copy link
Member

werebus commented Dec 12, 2024

Alright, I'm going to recommend that you uninstall Homebrew and try again:

sudo /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"

(If it's been a while, you might have to re-run "Make me an Admin" first)

@Aryanvkl
Copy link
Author

Ok. If I am not mistaken this command is for uninstalling it. So, for reinstall, do I follow the same process I did last time?

@werebus werebus changed the title Update Homebrew Failed Warn if Homebrew files are currently owned by another user Dec 12, 2024
@werebus
Copy link
Member

werebus commented Dec 12, 2024

It seems like you've gotten past your specific issue. But I'm going to leave this open because we should provide some guidance in the script output to new devs in this situation.

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

2 participants