My oh-my-zsh install which has been working for almost a year has just broken. When I open a terminal, I get:
/home/marcel/.oh-my-zsh/lib/theme-and-appearance.zsh:2: colors: function definition file not found
/home/marcel/.oh-my-zsh/oh-my-zsh.sh:78: compinit: function definition file not found
/home/marcel/.oh-my-zsh/plugins/git/git.plugin.zsh:80: command not found: compdef
/home/marcel/.oh-my-zsh/plugins/git/git.plugin.zsh:93: command not found: compdef
/home/marcel/.oh-my-zsh/plugins/git/git.plugin.zsh:100: command not found: compdef
/home/marcel/.oh-my-zsh/plugins/git/git.plugin.zsh:109: command not found: compdef
/home/marcel/.oh-my-zsh/plugins/git/git.plugin.zsh:119: command not found: compdef
/home/marcel/.oh-my-zsh/plugins/git/git.plugin.zsh:129: command not found: compdef
/home/marcel/.oh-my-zsh/plugins/git/git.plugin.zsh:138: command not found: compdef
/home/marcel/.oh-my-zsh/plugins/git/git.plugin.zsh:144: command not found: compdef
/home/marcel/.oh-my-zsh/plugins/git/git.plugin.zsh:147: command not found: compdef
/home/marcel/.oh-my-zsh/plugins/git/git.plugin.zsh:150: command not found: compdef
/home/marcel/.oh-my-zsh/plugins/git/git.plugin.zsh:153: command not found: compdef
/home/marcel/.oh-my-zsh/plugins/git/git.plugin.zsh:163: command not found: compdef
/home/marcel/.oh-my-zsh/plugins/git/git.plugin.zsh:166: command not found: compdef
/home/marcel/.oh-my-zsh/plugins/git/git.plugin.zsh:168: command not found: compdef
/home/marcel/.oh-my-zsh/plugins/git/git.plugin.zsh:182: command not found: compdef
/home/marcel/.oh-my-zsh/plugins/git/git.plugin.zsh:193: command not found: compdef
$SPACESHIP_PROMPT_TRUNC is deprecated. Use $SPACESHIP_DIR_TRUNC instead.
spaceship_setup:3: add-zsh-hook: function definition file not found
spaceship_setup:4: add-zsh-hook: function definition file not found
$SPACESHIP_PROMPT_TRUNC is deprecated. Use $SPACESHIP_DIR_TRUNC instead.
spaceship_setup:3: add-zsh-hook: function definition file not found
spaceship_setup:4: add-zsh-hook: function definition file not found
I have looked around and a lot of other answers suggest running compaudit
. Running this gives me zsh: compaudit: function definition file not found
.
What I have tried:
rm ~/.zcompdump*
- Reinstalling oh-my-zsh
- Reinstalling zsh from source
- Adding
/usr/share/zsh/functions
to$fpath
chown -R 755 /usr/share/zsh/functions
- Loading and running
compaudit
inside ofzsh -f
My environment:
uname -a
:Linux Hermes 4.11.6-1-ARCH #1 SMP PREEMPT Sat Jun 17 08:19:42 CEST 2017 x86_64 GNU/Linux
zsh --version
:zsh 5.3.1 (x86_64-unknown-linux-gnu)
which zsh
:/usr/local/bin/zsh
Edit:
I have confirmed that it is a permissions problem. If I do
sudo zsh -f
autoload -U compaudit
compaudit
The command works as expected. I then did
sudo chmod 777 /usr/share/zsh/ -R # Just for testing I promise
and I still got zsh: compaudit: function definition file not found
when running compaudit
.
I also tried
sudo chown user:users /usr/share/zsh/ -R
and it's still not working. If all these files are owned by my user AND are 777 how does zsh work as root and not as my user?