Solve the Problem of invalid installing Zsh in Bash On Ubuntu On Window. Attachment installation instructions
Preface
Zsh is a great Shell. People who use Linux and Mac systems basically know the existence of zsh.
Problem
After Zsh is installed, zsh can be used, but after restart, It is restored to the default bash.
After installation, run the following command:chsh -s /bin/zsh
Switch the default shell.
Then, the $ SHELL variable is output as follows:
root@XY ~ # echo $SHELL/bin/bash
The setting is invalid. I thought it was about to restart.
Restart Bash On Ubuntu On Window.
The result is still invalid.
Solution
I opened an issues on BashOnWindows GitHub. The following method may be the easiest.
Add zsh to the. bashrc configuration file
Open the. bashrc file:
root@XY ~ # vi ~/.bashrc
Add bash-c zsh to the end of the file.
Then restart the terminal.
Attachment: Installation
Zsh is now popular with the use of oh-my-zsh for configuration, so you need to install oh-my-zsh.
Install zsh
Installing ZSH
root@XY ~ # sudo apt-get install zsh
Install oh-my-zsh
You can install oh-my-zsh in the following two ways.
Via curl
root@XY ~ # sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
Via wget
root@XY ~ # sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
For more information, see oh-my-zsh # basic-installation
If you have a better method, I hope you can share it with me.
Zsh installation and Configuration Guide
Nine reasons for using Zsh
Zsh usage tips
Install the ultimate Shell Zsh in Linux
This article permanently updates the link address: