Just installed Homebrew, and I can't update it, even though it's outdated


(ema1982) #1

I’m trying to install youtube-dl. Figured I’d try using Homebrew to do that, so I installed it by copying and pasting the line on the homepage into Terminal (I have macOS High Sierra). I think I managed to get Homebrew installed. Then I tried installing youtube-dl per the instructions and got this:

brew install youtube-dl
Warning: You are using OS X 10.13.
We do not provide support for this pre-release version.
You may encounter build failures or other breakages.
==> Downloading https://yt-dl.org/downloads/2015.11.21/youtube-dl-2015.11.21.tar
==> Downloading from https://github.com/rg3/youtube-dl/releases/download/2015.11

curl: (22) The requested URL returned error: 404 Not Found
Error: Failed to download resource "youtube-dl"
Download failed: https://github.com/rg3/youtube-dl/releases/download/2015.11.21/youtube-dl-2015.11.21.tar.gz

It is obviously trying to install a very old version of youtube-dl. So I figure an update of Homebrew is in order. So I type in ‘brew update’ and this is what I get:

brew update
Error: The /usr/local directory is not writable.
Even if this directory was writable when you installed Homebrew, other
software may change permissions on this directory. Some versions of the
"InstantOn" component of Airfoil are known to do this.

You should probably change the ownership and permissions of /usr/local
back to your user account.
  sudo chown -R $(whoami):admin /usr/local
Elaines-MacBook-Pro:~ elainearias$ sudo chown -R $(whoami):admin /usr/local
Password:
chown: /usr/local: Operation not permitted

So I tried typing in the suggested command and I get the above error: Operation not permitted. So I type in ‘brew doctor’ and I get this wall of text.

brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!

Warning: The /usr/local is not writable.

You should probably change the ownership and permissions of /usr/local
back to your user account.
  sudo chown -R $(whoami) /usr/local

Warning: The /usr/local directory is not writable.
Even if this directory was writable when you installed Homebrew, other
software may change permissions on this directory. Some versions of the
"InstantOn" component of Airfoil are known to do this.

You should probably change the ownership and permissions of /usr/local
back to your user account.
  sudo chown -R $(whoami):admin /usr/local

Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following "config" scripts:
    /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6m-config
    /Library/Frameworks/Python.framework/Versions/3.6/bin/python3-config
    /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6-config
    /Library/Frameworks/Python.framework/Versions/2.7/bin/python2-config
    /Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7-config
    /Library/Frameworks/Python.framework/Versions/2.7/bin/python-config

Warning: Python is installed at /Library/Frameworks/Python.framework

Homebrew only supports building against the System-provided Python or a
brewed Python. In particular, Pythons installed to /Library can interfere
with other software installs.

Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected dylibs:
    /usr/local/lib/libosxfuse.2.dylib

Warning: Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected header files:
    /usr/local/include/node/v8-platform.h
    /usr/local/include/node/v8-version.h
    /usr/local/include/node/node_version.h
    /usr/local/include/node/libplatform/libplatform.h
    /usr/local/include/node/ares_version.h
    /usr/local/include/node/v8-testing.h
    /usr/local/include/node/node_buffer.h
    /usr/local/include/node/v8-profiler.h
    /usr/local/include/node/uv-unix.h
    /usr/local/include/node/v8.h
    /usr/local/include/node/uv-threadpool.h
    /usr/local/include/node/pthread-fixes.h
    /usr/local/include/node/ares_build.h
    /usr/local/include/node/v8-experimental.h
    /usr/local/include/node/uv.h
    /usr/local/include/node/uv-win.h
    /usr/local/include/node/v8-util.h
    /usr/local/include/node/ares.h
    /usr/local/include/node/uv-aix.h
    /usr/local/include/node/uv-errno.h
    /usr/local/include/node/tree.h
    /usr/local/include/node/node.h
    /usr/local/include/node/v8-debug.h
    /usr/local/include/node/uv-sunos.h
    /usr/local/include/node/android-ifaddrs.h
    /usr/local/include/node/uv-version.h
    /usr/local/include/node/uv-darwin.h
    /usr/local/include/node/uv-bsd.h
    /usr/local/include/node/ares_rules.h
    /usr/local/include/node/zlib.h
    /usr/local/include/node/node_object_wrap.h
    /usr/local/include/node/nameser.h
    /usr/local/include/node/stdint-msvc2008.h
    /usr/local/include/node/openssl/pem2.h
    /usr/local/include/node/openssl/pem.h
    /usr/local/include/node/openssl/ssl3.h
    /usr/local/include/node/openssl/ossl_typ.h
    /usr/local/include/node/openssl/dtls1.h
    /usr/local/include/node/openssl/err.h
    /usr/local/include/node/openssl/bn.h
    /usr/local/include/node/openssl/blowfish.h
    /usr/local/include/node/openssl/cms.h
    /usr/local/include/node/openssl/engine.h
    /usr/local/include/node/openssl/conf_api.h
    /usr/local/include/node/openssl/x509.h
    /usr/local/include/node/openssl/asn1_mac.h
    /usr/local/include/node/openssl/ui.h
    /usr/local/include/node/openssl/kssl.h
    /usr/local/include/node/openssl/sha.h
    /usr/local/include/node/openssl/symhacks.h
    /usr/local/include/node/openssl/asn1.h
    /usr/local/include/node/openssl/opensslconf.h
    /usr/local/include/node/openssl/bio.h
    /usr/local/include/node/openssl/rc2.h
    /usr/local/include/node/openssl/dh.h
    /usr/local/include/node/openssl/ui_compat.h
    /usr/local/include/node/openssl/x509v3.h
    /usr/local/include/node/openssl/ssl23.h
    /usr/local/include/node/openssl/conf.h
    /usr/local/include/node/openssl/md5.h
    /usr/local/include/node/openssl/x509_vfy.h
    /usr/local/include/node/openssl/txt_db.h
    /usr/local/include/node/openssl/safestack.h
    /usr/local/include/node/openssl/ecdsa.h
    /usr/local/include/node/openssl/objects.h
    /usr/local/include/node/openssl/pkcs12.h
    /usr/local/include/node/openssl/crypto.h
    /usr/local/include/node/openssl/opensslv.h
    /usr/local/include/node/openssl/pkcs7.h
    /usr/local/include/node/openssl/obj_mac.h
    /usr/local/include/node/openssl/buffer.h
    /usr/local/include/node/openssl/ssl.h
    /usr/local/include/node/openssl/srp.h
    /usr/local/include/node/openssl/camellia.h
    /usr/local/include/node/openssl/evp.h
    /usr/local/include/node/openssl/e_os2.h
    /usr/local/include/node/openssl/md4.h
    /usr/local/include/node/openssl/hmac.h
    /usr/local/include/node/openssl/aes.h
    /usr/local/include/node/openssl/comp.h
    /usr/local/include/node/openssl/cast.h
    /usr/local/include/node/openssl/rc4.h
    /usr/local/include/node/openssl/stack.h
    /usr/local/include/node/openssl/des.h
    /usr/local/include/node/openssl/ocsp.h
    /usr/local/include/node/openssl/ec.h
    /usr/local/include/node/openssl/ecdh.h
    /usr/local/include/node/openssl/rand.h
    /usr/local/include/node/openssl/ts.h
    /usr/local/include/node/openssl/pqueue.h
    /usr/local/include/node/openssl/dso.h
    /usr/local/include/node/openssl/seed.h
    /usr/local/include/node/openssl/archs/aix-gcc/opensslconf.h
    /usr/local/include/node/openssl/archs/solaris-x86-gcc/opensslconf.h
    /usr/local/include/node/openssl/archs/linux-elf/opensslconf.h
    /usr/local/include/node/openssl/archs/linux64-s390x/opensslconf.h
    /usr/local/include/node/openssl/archs/solaris64-x86_64-gcc/opensslconf.h
    /usr/local/include/node/openssl/archs/VC-WIN32/opensslconf.h
    /usr/local/include/node/openssl/archs/linux-x32/opensslconf.h
    /usr/local/include/node/openssl/archs/linux-armv4/opensslconf.h
    /usr/local/include/node/openssl/archs/linux-x86_64/opensslconf.h
    /usr/local/include/node/openssl/archs/linux-aarch64/opensslconf.h
    /usr/local/include/node/openssl/archs/aix64-gcc/opensslconf.h
    /usr/local/include/node/openssl/archs/darwin-i386-cc/opensslconf.h
    /usr/local/include/node/openssl/archs/darwin64-x86_64-cc/opensslconf.h
    /usr/local/include/node/openssl/archs/linux-ppc/opensslconf.h
    /usr/local/include/node/openssl/archs/BSD-x86/opensslconf.h
    /usr/local/include/node/openssl/archs/VC-WIN64A/opensslconf.h
    /usr/local/include/node/openssl/archs/linux-ppc64/opensslconf.h
    /usr/local/include/node/openssl/archs/linux32-s390x/opensslconf.h
    /usr/local/include/node/openssl/archs/BSD-x86_64/opensslconf.h
    /usr/local/include/node/openssl/modes.h
    /usr/local/include/node/openssl/ssl2.h
    /usr/local/include/node/openssl/rsa.h
    /usr/local/include/node/openssl/krb5_asn.h
    /usr/local/include/node/openssl/des_old.h
    /usr/local/include/node/openssl/ripemd.h
    /usr/local/include/node/openssl/whrlpool.h
    /usr/local/include/node/openssl/tls1.h
    /usr/local/include/node/openssl/mdc2.h
    /usr/local/include/node/openssl/dsa.h
    /usr/local/include/node/openssl/srtp.h
    /usr/local/include/node/openssl/asn1t.h
    /usr/local/include/node/openssl/cmac.h
    /usr/local/include/node/openssl/ebcdic.h
    /usr/local/include/node/openssl/idea.h
    /usr/local/include/node/openssl/lhash.h
    /usr/local/include/node/v8config.h
    /usr/local/include/node/uv-linux.h
    /usr/local/include/node/zconf.h
    /usr/local/include/node/pthread-barrier.h

Warning: Unbrewed .la files were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected .la files:
    /usr/local/lib/libosxfuse.la

Warning: You are using OS X 10.13.
We do not provide support for this pre-release version.
You may encounter build failures or other breakages.

Warning: Ruby version 2.3.3 is unsupported on 10.13. Homebrew
is developed and tested on Ruby 2.0, and may not work correctly
on other Rubies. Patches are accepted as long as they don't cause breakage
on supported Rubies.

Warning: Your Homebrew is outdated.
You haven't updated for at least 24 hours. This is a long time in brewland!
To update Homebrew, run `brew update`.

I can’t update homebrew and I am at a loss as to how to fix it, as I apparently cannot change the permissions for the directory in question.


(Israel Buitron) #2

I have some similar issue.
I can’t execute brew upgrade without having this message:

Error: /usr/local is not writable. You should change the
ownership and permissions of /usr/local back to your
user account:
  sudo chown -R $(whoami) /usr/local

And if I execute that chmod it throws again an error message, like this:

$ sudo chown -R $(whoami) /usr/local              
Password:
chown: /usr/local: Operation not permitted

Same messages is thrown when I execute brew update.

What can we do? :frowning: