Brew: `brew update` gives lots of "Permission denied (publickey)" git errors

Created on 29 Sep 2016  路  5Comments  路  Source: Homebrew/brew

  • [x] Ran brew doctor, fixed as many issues as possible and retried your prior step?

    Bug reports:

Unable to use brew update, output:

> brew update                                                                                                                                                                                                             
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Error: Fetching /usr/local/Homebrew/Library/Taps/caskroom/homebrew-cask failed!
Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-php failed!
Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core failed!
Fetching /usr/local/Homebrew/Library/Taps/homebrew/homebrew-dupes failed!

Brew version:

> brew -v                                                                                                                                                                                                             
Homebrew 1.0.5-35-g8608e48
Homebrew/homebrew-core (git revision 227e; last commit 2016-09-22)

Most helpful comment

If you've upgrade to macOS Sierra there's a known issue (which seems deliberate on Apple's part) where it no longer reads your SSH passphrase from the Keychain, so every time you reboot you have to manually ssh-add -A if you fetch stuff from Git over SSH, otherwise you will see issues like that.

See https://github.com/jirsbek/SSH-keys-in-macOS-Sierra-keychain and the various sources linked to from there.

All 5 comments

brew update --verbose will help you figure out which repositories you need to fix your GitHub access credentials for.

If you've upgrade to macOS Sierra there's a known issue (which seems deliberate on Apple's part) where it no longer reads your SSH passphrase from the Keychain, so every time you reboot you have to manually ssh-add -A if you fetch stuff from Git over SSH, otherwise you will see issues like that.

See https://github.com/jirsbek/SSH-keys-in-macOS-Sierra-keychain and the various sources linked to from there.

@DomT4 ssh-add -A fixed the problem, thanks.

(although, weirdly, git-over-ssh has been working for me this entire time, just not with homebrew)

@gfarrell Same thing here. Only experienced the issue with Homebrew for some reason.

Thanks to @DomT4, ssh-add -A did the job 馃憤

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hktalent picture hktalent  路  4Comments

cdekok picture cdekok  路  4Comments

VagelisD picture VagelisD  路  3Comments

DomT4 picture DomT4  路  3Comments

kirk86 picture kirk86  路  3Comments