What does it mean and how can I fix it?
zsh compinit: insecure directories, run compaudit for list.
Ignore insecure directories and continue [y] or abort compini
I got the same warnings when I sudo -i
starting a root shell, @chakrit's solution didn't work for me.
But I found -u
switch of compinit
works, e.g. in your .zshrc/zshenv or where you called compinit
compinit -u
NB: Not recommended for production system
See also http://zsh.sourceforge.net/Doc/Release/Completion-System.html#Initialization
on Mojave, this did the trick :
sudo chmod go-w /usr/local/share
This was the only thing that worked for me from https://github.com/zsh-users/zsh-completions/issues/433#issuecomment-600582607. Thanks https://github.com/malaquiasdev!
$ cd /usr/local/share/
$ sudo chmod -R 755 zsh
$ sudo chown -R root:staff zsh
This answer is mostly a reference for myself to use in the future, as most answers do not provide a full-fledged solution. Here it is:
First run:
compinit
For every single path that is printed run the following the commands:
sudo chown $(whoami) PATH_HERE
sudo chmod -R 755 PATH_HERE
Simple example, let's say one of the paths that gets printed after running compinit is "/usr/local/share/zsh". Then:
sudo chown $(whoami) /usr/local/share/zsh
sudo chmod -R 755 /usr/local/share/zsh
MAC OS X solution :
$ sudo chmod -R 755 /usr/local/share/zsh
$ sudo chown -R root:staff /usr/local/share/zsh
Also "user:staff = default root user on OSX.