High Sierra `brew install openssh` --> "The post-install step did not complete successfully"


(Benjamin Bergman) #1

I just updated my machine to High Sierra. The built in ssh seems to have broken bind-address support so I want to install openssh through brew as there have been reports this has fixed the issue. When I do brew install openssh I get “The post-install step did not complete successfully”. With verbose:

==> Downloading https://homebrew.bintray.com/bottles/openssh-7.7p1.high_sierra.bottle.tar.gz
Already downloaded: /Users/benjamin.bergman/Library/Caches/Homebrew/openssh-7.7p1.high_sierra.bottle.tar.gz
==> Verifying openssh-7.7p1.high_sierra.bottle.tar.gz checksum
==> Pouring openssh-7.7p1.high_sierra.bottle.tar.gz
tar xzf /Users/benjamin.bergman/Library/Caches/Homebrew/openssh-7.7p1.high_sierra.bottle.tar.gz
==> Finishing up
ln -s ../Cellar/openssh/7.7p1/bin/scp scp
ln -s ../Cellar/openssh/7.7p1/bin/sftp sftp
ln -s ../Cellar/openssh/7.7p1/bin/slogin slogin
ln -s ../Cellar/openssh/7.7p1/bin/ssh ssh
ln -s ../Cellar/openssh/7.7p1/bin/ssh-add ssh-add
ln -s ../Cellar/openssh/7.7p1/bin/ssh-agent ssh-agent
ln -s ../Cellar/openssh/7.7p1/bin/ssh-keygen ssh-keygen
ln -s ../Cellar/openssh/7.7p1/bin/ssh-keyscan ssh-keyscan
ln -s ../Cellar/openssh/7.7p1/sbin/sshd sshd
ln -s ../../../Cellar/openssh/7.7p1/share/man/man1/scp.1 scp.1
ln -s ../../../Cellar/openssh/7.7p1/share/man/man1/sftp.1 sftp.1
ln -s ../../../Cellar/openssh/7.7p1/share/man/man1/ssh-add.1 ssh-add.1
ln -s ../../../Cellar/openssh/7.7p1/share/man/man1/ssh-agent.1 ssh-agent.1
ln -s ../../../Cellar/openssh/7.7p1/share/man/man1/ssh-keygen.1 ssh-keygen.1
ln -s ../../../Cellar/openssh/7.7p1/share/man/man1/ssh-keyscan.1 ssh-keyscan.1
ln -s ../../../Cellar/openssh/7.7p1/share/man/man1/ssh.1 ssh.1
ln -s ../../../Cellar/openssh/7.7p1/share/man/man5/moduli.5 moduli.5
ln -s ../../../Cellar/openssh/7.7p1/share/man/man5/ssh_config.5 ssh_config.5
ln -s ../../../Cellar/openssh/7.7p1/share/man/man5/sshd_config.5 sshd_config.5
ln -s ../../../Cellar/openssh/7.7p1/share/man/man8/sftp-server.8 sftp-server.8
ln -s ../../../Cellar/openssh/7.7p1/share/man/man8/ssh-keysign.8 ssh-keysign.8
ln -s ../../../Cellar/openssh/7.7p1/share/man/man8/ssh-pkcs11-helper.8 ssh-pkcs11-helper.8
ln -s ../../../Cellar/openssh/7.7p1/share/man/man8/sshd.8 sshd.8
/usr/bin/sandbox-exec -f /tmp/homebrew20180614-72186-cls6zd.sb nice /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3_2/bin/ruby -W0 -I /usr/local/Homebrew/Library/Homebrew -- /usr/local/Homebrew/Library/Homebrew/postinstall.rb /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/openssh.rb -vv
Warning: The post-install step did not complete successfully
You can try again using `brew postinstall openssh`
==> Summary
🍺  /usr/local/Cellar/openssh/7.7p1: 44 files, 4.4MB

I don’t see anything obvious in there about why it might be failing so I’m at a bit of a loss.


(Claudia) #2

Can you please run

HOMEBREW_DEBUG=1 brew -v postinstall openssh

and post the output?


(Benjamin Bergman) #3

Aha! It looks like a permission issue

/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/openssh.rb
==> Postinstalling openssh
/usr/bin/sandbox-exec -f /tmp/homebrew20180614-56566-1yglcaf.sb nice /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3_2/bin/ruby -W0 -I /usr/local/Homebrew/Library/Homebrew -- /usr/local/Homebrew/Library/Homebrew/postinstall.rb /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/openssh.rb -v
/usr/local/Homebrew/Library/Homebrew/postinstall.rb (Formulary::FromPathLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/openssh.rb
Warning: The post-install step did not complete successfully
You can try again using `brew postinstall openssh`
==> Permission denied @ dir_s_mkdir - /usr/local/etc/ssh
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3_2/lib/ruby/2.3.0/fileutils.rb:253:in `mkdir'
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3_2/lib/ruby/2.3.0/fileutils.rb:253:in `fu_mkdir'
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3_2/lib/ruby/2.3.0/fileutils.rb:227:in `block (2 levels) in mkdir_p'
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3_2/lib/ruby/2.3.0/fileutils.rb:225:in `reverse_each'
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3_2/lib/ruby/2.3.0/fileutils.rb:225:in `block in mkdir_p'
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3_2/lib/ruby/2.3.0/fileutils.rb:211:in `each'
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3_2/lib/ruby/2.3.0/fileutils.rb:211:in `mkdir_p'
/usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3_2/lib/ruby/2.3.0/pathname.rb:576:in `mkpath'
/usr/local/Homebrew/Library/Homebrew/extend/pathname.rb:217:in `cp_path_sub'
/usr/local/Homebrew/Library/Homebrew/install_renamed.rb:14:in `cp_path_sub'
/usr/local/Homebrew/Library/Homebrew/formula.rb:995:in `block (2 levels) in run_post_install'
/usr/local/Homebrew/Library/Homebrew/formula.rb:993:in `glob'
/usr/local/Homebrew/Library/Homebrew/formula.rb:993:in `glob'
/usr/local/Homebrew/Library/Homebrew/formula.rb:993:in `block in run_post_install'
/usr/local/Homebrew/Library/Homebrew/utils.rb:556:in `with_env'
/usr/local/Homebrew/Library/Homebrew/formula.rb:990:in `run_post_install'
/usr/local/Homebrew/Library/Homebrew/postinstall.rb:16:in `<main>'

I suspect I installed something else with brew as the admin user as /usr/local/etc/ is owned by that user. doing a chown to make me the owner solved it. Thanks!


(Lawal736) #4

i am having a similar problem but i can not seem to figure it out. i have just installed PHP on my OsX and when i run Pecl install command i get an error :slight_smile:

pecl install trader
dyld: Library not loaded: /usr/local/opt/openldap/lib/libldap-2.4.2.dylib
Referenced from: /usr/local/Cellar/php/7.2.11/bin/php
Reason: image not found
Abort trap: 6

MacBook-ML-2:~ LL$ brew postinstall php

==> Postinstalling php

Warning: The post-install step did not complete successfully

You can try again using brew postinstall php

MacBook-ML-2:~ LL$ HOMEBREW_DEBUG=1 brew -v postinstall openssh

/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/openssh.rb

==> Postinstalling openssh

/usr/bin/sandbox-exec -f /private/tmp/homebrew20181105-14883-lvjr6l.sb nice /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -W0 -I /usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/…/ruby/2.3.0/gems/ruby-macho-2.1.0/lib:/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/…/ruby/2.3.0/gems/rubocop-rspec-1.30.0/lib:/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/…/ruby/2.3.0/gems/rubocop-0.59.1/lib:/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/…/ruby/2.3.0/gems/unicode-display_width-1.4.0/lib:/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/…/ruby/2.3.0/gems/ruby-progressbar-1.10.0/lib:/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/…/ruby/2.3.0/gems/rainbow-3.0.0/lib:/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/…/ruby/2.3.0/gems/powerpack-0.1.2/lib:/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/…/ruby/2.3.0/gems/plist-3.4.0/lib:/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/…/ruby/2.3.0/gems/parser-2.5.1.2/lib:/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/…/ruby/2.3.0/gems/parallel-1.12.1/lib:/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/…/ruby/2.3.0/gems/jaro_winkler-1.5.1/lib:/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/…/ruby/2.3.0/extensions/universal-darwin-18/2.3.0/jaro_winkler-1.5.1:/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/:/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/…/ruby/2.3.0/gems/backports-3.11.4/lib:/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/…/ruby/2.3.0/gems/ast-2.4.0/lib:/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/…/ruby/2.3.0/gems/activesupport-5.2.1/lib:/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/…/ruby/2.3.0/gems/tzinfo-1.2.5/lib:/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/…/ruby/2.3.0/gems/thread_safe-0.3.6/lib:/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/…/ruby/2.3.0/gems/minitest-5.11.3/lib:/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/…/ruby/2.3.0/gems/i18n-1.1.0/lib:/usr/local/Homebrew/Library/Homebrew/vendor/bundle-standalone/bundler/…/ruby/2.3.0/gems/concurrent-ruby-1.0.5/lib:/Library/Ruby/Gems/2.3.0/gems/did_you_mean-1.0.0/lib:/Library/Ruby/Site/2.3.0:/Library/Ruby/Site/2.3.0/x86_64-darwin17:/Library/Ruby/Site/2.3.0/universal-darwin17:/Library/Ruby/Site:/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/vendor_ruby/2.3.0:/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/vendor_ruby/2.3.0/x86_64-darwin17:/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/vendor_ruby/2.3.0/universal-darwin17:/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/vendor_ruby:/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0:/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/x86_64-darwin17:/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/universal-darwin17:/usr/local/Homebrew/Library/Homebrew – /usr/local/Homebrew/Library/Homebrew/postinstall.rb /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/openssh.rb -v

/usr/local/Homebrew/Library/Homebrew/postinstall.rb (Formulary::FromPathLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/openssh.rb

does anyone know what i need to do to fix this stuff .


(Sean Molenaar) #5

You could either reinstall PHP using brew reinstall php or you can install openldap using brew install openldap. It doesn’t have anything to do with the postinstall step though.