Cambia le autorizzazioni su / usr e / usr / local per collegare il pacchetto Homebrew


1

Come si cambiano le autorizzazioni per /usro /usr/local? Ho provato a farlo sudo chmod 775 /usr/local, ma dice

chmod: Unable to change file mode on /usr/local: Operation not permitted`

così ho corso ls -l /usre ha mostrato

drwxr-xr-x   17 root  wheel    544 Nov 20 14:08 local

(ha anche mostrato le cose per le altre cose lì dentro, ma quelle sono irrilevanti). Inoltre, perché devo usare sudo, poiché ho i privilegi di amministratore, non dovrebbe bastare?

Sto cercando di modificare le autorizzazioni in modo da poter installare simple2d utilizzando Homebrew. Quando corro brew link simple2d, dice che non può ricollegare in / usr / local / Frameworks, ma Frameworks non esiste, quindi ho provato a crearlo e non mi permetterà a causa delle autorizzazioni.

Sto usando macOS Mojave. Su un mac con protezione dell'integrità del sistema

Quando eseguo le brew doctoruscite

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 or file an issue; just ignore this. Thanks!

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.7/bin/python3.7-config
  /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7m-config
  /Library/Frameworks/Python.framework/Versions/3.7/bin/python3-config

Warning: You have MacPorts or Fink installed:
  /opt/local/bin/port

This can cause trouble. You don't have to uninstall them, but you may want to
temporarily move them out of the way, e.g.

  sudo mv /opt/local ~/macports

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

Warning: Unbrewed static libraries 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 static libraries:
  /usr/local/lib/liblua.a

Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
  python@2
  python
  nano
  lua
  hamlib
  simple2d

1
Per prima cosa rimuovi i macport (o usa i macport che hai già al posto di Homebrew)
Segna il

Risposte:


0

Non dovresti mai aver bisogno di modificare tu stesso /usro le /usr/localautorizzazioni per installare qualsiasi pacchetto usando Homebrew.

simple2d non è disponibile con core (predefinito) rubinetto Homebrew. Per installarlo, seguire le istruzioni come indicato nel file Leggimi del progetto nel repository GitHub . Esegui brew updateseguito da brew upgrade. Successivamente eseguire i seguenti comandi:

brew tap simple2d / tap

brew install simple2d

Questo dovrebbe essere installato simple2dsul tuo Mac tramite Homebrew. Per garantire la sanità mentale dell'installazione Homebrew stessa, eseguire brew doctor.


L'ho fatto e ha dettoError: Could not symlink Frameworks/Simple2D /usr/local/Frameworks is not writable.
Mining15

Qual è l'output della corsa brew doctor?
Nimesh Neema,

ha prodotto un sacco di roba, sto escludendo il "file di intestazione imprevisto" e molte altre cose. Avvertenza: gli script "config" esistono al di fuori del sistema o delle directory Homebrew. ./configure Avvertenza: sono installati MacPorts o Fink: / opt / local / bin / port Ciò può causare problemi. Potresti volerli spostare temporaneamente di mezzo, ad esempio sudo mv / opt / local ~ / macportsAvvertenza Attenzione: hai fusti non collegati nella tua cantina Python @ 2 python nano lua hamlib simple2d
Mining15

@ Mining15 Modifica la domanda e incolla l'output così com'è.
Nimesh Neema,

Ho fatto qualche ricerca e ho scoperto che la protezione dell'integrità del sistema probabilmente fa confusione con le cose, o meglio, mi impedisce di fare confusione con le cose
Mining15

0

Innanzitutto, esegui la sudo mkdir /usr/local/Frameworkscreazione della cartella Frameworks. In secondo luogo, sudo chown -R $(whoami) $(brew --prefix)/*per darti le autorizzazioni adeguate per fare cose. Terzo, brew link simple2do qualunque pacchetto tu stia riscontrando problemi.

Utilizzando il nostro sito, riconosci di aver letto e compreso le nostre Informativa sui cookie e Informativa sulla privacy.
Licensed under cc by-sa 3.0 with attribution required.