macOS Big Sur后zsh报错:

/etc/zshrc:29: failed to load module `zsh/terminfo': dlopen(/usr/lib/zsh/5.3/zsh/terminfo.so, 9): image 
(anon):7: failed to load module `zsh/stat': dlopen(/usr/lib/zsh/5.3/zsh/stat.so, 9): image not found
current_epoch:1: failed to load module `zsh/datetime': dlopen(/usr/lib/zsh/5.3/zsh/datetime.so, 9): image not found
/Users/king/.oh-my-zsh/oh-my-zsh.sh:78: compinit: function definition file not found
/Users/king/.oh-my-zsh/lib/cli.zsh:59: command not found: compdef
detect-clipboard:3: failed to load module `zsh/parameter': dlopen(/usr/lib/zsh/5.3/zsh/parameter.so, 9): image not found
/Users/king/.oh-my-zsh/lib/completion.zsh:2: failed to load module `zsh/zle': dlopen(/usr/lib/zsh/5.3/zsh/zle.so, 9): image not found
/Users/king/.oh-my-zsh/lib/completion.zsh:13: failed to load module `zsh/zle': dlopen(/usr/lib/zsh/5.3/zsh/zle.so, 9): image not found
/Users/king/.oh-my-zsh/lib/completion.zsh:23: command not found: zstyle
/Users/king/.oh-my-zsh/lib/completion.zsh:75: bashcompinit: function definition file not found
/Users/king/.oh-my-zsh/lib/directories.zsh:32: command not found: compdef
/Users/king/.oh-my-zsh/lib/functions.zsh:100: failed to load module `zsh/langinfo': dlopen(/usr/lib/zsh/5.3/zsh/langinfo.so, 9): image not found
/Users/king/.oh-my-zsh/lib/key-bindings.zsh:19: command not found: bindkey
/Users/king/.oh-my-zsh/lib/key-bindings.zsh:78: failed to load module `zsh/terminfo': dlopen(/usr/lib/zsh/5.3/zsh/terminfo.so, 9): image not found
/Users/king/.oh-my-zsh/lib/key-bindings.zsh:83: command not found: bindkey
/Users/king/.oh-my-zsh/lib/key-bindings.zsh:115: failed to load module `zsh/zle': dlopen(/usr/lib/zsh/5.3/zsh/zle.so, 9): image not found
/Users/king/.oh-my-zsh/lib/key-bindings.zsh:116: command not found: bindkey
env_default:1: failed to load module `zsh/parameter': dlopen(/usr/lib/zsh/5.3/zsh/parameter.so, 9): image not found
/Users/king/.oh-my-zsh/lib/misc.zsh:28: failed to load module `zsh/parameter': dlopen(/usr/lib/zsh/5.3/zsh/parameter.so, 9): image not found
/Users/king/.oh-my-zsh/lib/termsupport.zsh:109: add-zsh-hook: function definition file not found
/Users/king/.oh-my-zsh/plugins/git/git.plugin.zsh:112: command not found: compdef
/Users/king/.oh-my-zsh/plugins/git/git.plugin.zsh:116: is-at-least: function definition file not found
/Users/king/.oh-my-zsh/plugins/git/git.plugin.zsh:130: command not found: compdef
/Users/king/.oh-my-zsh/plugins/git/git.plugin.zsh:255: is-at-least: function definition file not found
zsh: failed to load module `zsh/zle': dlopen(/usr/lib/zsh/5.3/zsh/zle.so, 9): image not found

 

解决方法:

# List of acceptable shells for chpass(1).
# Ftpd will not allow users to connect who are not using
# one of these shells.

/bin/bash
/bin/csh
/bin/ksh
/bin/sh
/bin/tcsh
  /bin/zsh #zsh只保留这一项
  /usr/local/Cellar/zsh/5.8/bin/zsh-5.8 #brew安装的话,zsh只保留这一项
 
  #  删除 /usr/local/bin/zsh  这一项 
~                                                                               
~                                                                               
~                                                                               
~                                                                               
:wq

切换bash为zsh

chsh -s /bin/zsh

chsh -s /usr/local/Cellar/zsh/5.8/bin/zsh-5.8

 

zsh又好用了。

posted on 2021-01-20 16:18  时之沙漠  阅读(1339)  评论(0编辑  收藏  举报