6

When I run fakeroot in zsh it always gives me this warning:

zsh compinit: insecure directories, run compaudit for list.
Ignore insecure directories and continue [y] or abort compinit [n]? 

I can continue by pressing y and then fakeroot works.

I'm wondering what this error message is and how to fix it.

(If I press n fakeroot still continues (verified with whoami), which seems odd to me.)

4 Answers 4

15

This made the error go away:

cd /usr/local/share/zsh
sudo chmod -R 755 ./site-functions
sudo chown -R root:root ./site-functions

I'm still unsure what the error meant or why it happened, though.

Credit: this answer on StackOverflow which in turn got the solution from a post on the zsh mailing list

1
2

I simply followed what was written there.

zsh compinit: insecure directories, run compaudit for list.
Ignore insecure directories and continue [y] or abort compinit [n]? 

I ignored these. After that, I ran compaudit,

# compaudit

It showed me 2 directories,

/usr/local/share/zsh/
/usr/local/share/zsh/site-functions/

So, insecure means something is wrong with their permissions, I changed the permissions to secure them and the error went away.

I also checked that both directories were empty, so I deleted both of them, which I would not recommend, but still I did.

1

To Fix Error

zsh compinit: insecure files, run compaudit for list. Ignore insecure files and continue [y] or abort compinit [n]?

I ran 2 commands:

command 1.

compaudit

output:

There are insecure files:
/usr/share/zsh/vendor-completions/_code

Then I ran:

command 2.

sudo chown root /usr/share/zsh/vendor-completions/_code

cheers

1
  • This worked, but now the terminal take some time (after open) until be ready to type.
    – Pablo
    Sep 30, 2020 at 9:57
0

This morning, some packages in my system updated, and left me with this error message.

Apparently, something in the update changed the username and group to numbers, instead of root, as so:

# There are insecure files: /usr/share/zsh/vendor-completions/_code
# sudo ls -alh
-rw-r--r-- 1  131  142 2.6K 2019-10-10 16:28 _code

I simply changed the user and group for this file back to root and the problem went away. I did not need to change any permissions, and would caution against doing so unless the underlying cause of the problem is understood.

sudo chown root _code && sudo chgrp root _code

After switching 131 and 142 back to root, this error message from zsh went away.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.