LoginSignup
0
0

More than 1 year has passed since last update.

zsh compinit: insecure directories, run compaudit for list. を解決した

Last updated at Posted at 2023-01-02

はじめに

  • macbookで別アカウントのアドミンユーザを作成したところ、元のアドミンユーザにて以下のエラーが警告文が発生してしまった。
zsh compinit: insecure directories, run compaudit for list.

$ compaudit
There are insecure directories:
/usr/local/share/zsh/site-functions
/usr/local/share/zsh
  • このメッセージは新規ターミナルを開いた際に毎回出てきてしまい、なんとか消したい気持ちだった。

やったこと

  • こちらの記事を参考に実行してみましたが、変わらず。

  • brew doctorを試してみた。
$ brew doctor

Warning: The following directories are not writable by your user:
/usr/local/share/aclocal
/usr/local/share/doc
/usr/local/share/info
/usr/local/share/locale
/usr/local/share/man
/usr/local/share/man/man1
/usr/local/share/man/man3
/usr/local/share/man/man5
/usr/local/share/man/man7
/usr/local/share/man/man8
/usr/local/share/zsh
/usr/local/share/zsh/site-functions
/usr/local/var/homebrew/linked
/usr/local/var/homebrew/locks

You should change the ownership of these directories to your user.
  sudo chown -R $(whoami) /usr/local/share/aclocal /usr/local/share/doc /usr/local/share/info /usr/local/share/locale /usr/local/share/man /usr/local/share/man/man1 /usr/local/share/man/man3 /usr/local/share/man/man5 /usr/local/share/man/man7 /usr/local/share/man/man8 /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var/homebrew/linked /usr/local/var/homebrew/locks

And make sure that your user has write permission.
  chmod u+w /usr/local/share/aclocal /usr/local/share/doc /usr/local/share/info /usr/local/share/locale /usr/local/share/man /usr/local/share/man/man1 /usr/local/share/man/man3 /usr/local/share/man/man5 /usr/local/share/man/man7 /usr/local/share/man/man8 /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var/homebrew/linked /usr/local/var/homebrew/locks

解決方法

  • 上記の$brew doctorでも分かる通り、/usr/local/share/zsh /usr/local/share/zsh/site-functions の権限が新規ユーザに移ってしまったと考えられるので、オーナーとパーミッションを変更する。
$ sudo chown -R $(whoami) /usr/local/share/zsh /usr/local/share/zsh/site-functions

$ chmod u+w /usr/local/share/zsh /usr/local/share/zsh/site-functions
  • これで無事に解決しました。
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0