解決升級系統為MacOS Big Sur后zsh報錯的問題


 

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又好用了。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM