-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
Installing ZSH
This wiki is automatically published from ohmyzsh/wiki. To edit this page, go to ohmyzsh/wiki, make your changes and submit a Pull Request.
Oh My Zsh is a framework for Zsh, the Z shell.
- In order for Oh My Zsh to work, Zsh must be installed.
- Please run
zsh --version
to confirm. - Expected result:
zsh 5.0.8
or more recent
- Please run
- Additionally, Zsh should be set as your default shell.
- Please run
echo $SHELL
from a new terminal to confirm. - Expected result:
/usr/bin/zsh
or similar
- Please run
If necessary, follow these steps to install Zsh:
-
There are two main ways to install Zsh:
- With the package manager of your choice, e.g.
sudo apt install zsh
(see below for more examples) - From source, following the instructions from the Zsh FAQ.
- With the package manager of your choice, e.g.
-
Verify installation by running
zsh --version
. Expected result:zsh 5.0.8
or more recent. -
Make it your default shell:
chsh -s $(which zsh)
or usesudo lchsh $USER
if you are on Fedora.- Note that this will not work if Zsh is not in your authorized shells list (
/etc/shells
) or if you don't have permission to usechsh
. If that's the case you'll need to use a different procedure. - If you use
lchsh
you need to type/bin/zsh
to make it your default shell.
- Note that this will not work if Zsh is not in your authorized shells list (
-
Log out and log back in again to use your new default shell.
-
Test that it worked with
echo $SHELL
. Expected result:/bin/zsh
or similar. -
Test with
$SHELL --version
. Expected result: 'zsh 5.8' or similar
Try zsh --version
before installing it from Homebrew. Preferably newer than or equal to 5.0.8
.
brew install zsh
To set zsh as your default shell, execute the following assuming a default install of Homebrew
-
Recent macOS versions:
For m1 macs:
chsh -s $(which zsh)
For intel macs:
chsh -s /usr/local/bin/zsh
-
macOS High Sierra and older:
chsh -s /bin/zsh
If you get an error for non-stadard shell you can try running first
sudo sh -c "echo $(which zsh) >> /etc/shells"
Assuming you have Homebrew installed. If not, most versions of macOS ship zsh by default, but it's normally an older version. Alternatively, you may also use MacPorts
sudo port install zsh zsh-completions
apt install zsh
If you don't have apt
, the recommended package manager for end users
[1]
[2]
[3]
[4]
, you can try apt-get
or aptitude
.
Other distributions that apply include: Linux Mint, elementary OS, Zorin OS, Raspbian, MX Linux, Deepin.
zypper install zsh
pacman -S zsh
xbps-install zsh
dnf install zsh
To install the package:
pkg_add zsh
To install the package:
pkg install zsh
To install the port:
cd /usr/ports/shells/zsh/ && make install clean
To reduce memory usage, optionally enable zsh-mem options with
make config
before running "make install".
sudo yum update && sudo yum -y install zsh
Install the zsh package using the installer. Unfortunately Cygwin doesn't have a standard command line interface. You could, however, setup apt-cyg and install zsh as follows:
apt-cyg install zsh
The easiest way to change the default shell is to set your SHELL user environment variable. Search for "Edit Environment variables for your account" to bring up the environment variables window, create a new variable named "SHELL" and give it the value "/usr/bin/zsh/".
Alternatively: Open Cygwin (in BASH) then type:
sudo nano ~/.bashrc
Once the .bashrc file is open, add this line to the very top:
exec zsh
Close and save the file. Close and reopen Cygwin. It will execute the command every time you load the terminal and run your zsh shell.
eopkg it zsh
emerge app-shells/zsh
apk add zsh
pacman -S zsh
Termux is an terminal emulator for Android but has modern feature like Debian and Ubuntu (Termux has Bash shell and Busybox GNU-like programs). For the package manager, Termux using an Debian/Ubuntu package manager, APT. To install the package, run this command:
pkg install zsh
The command looks like FreeBSD package manager (pkg
). Or you can run this command:
apt update && apt upgrade
apt install zsh
To set zsh as your default shell, run this command:
chsh -s zsh
To install zsh, you must add the community repo to your $KISS_PATH
.
kiss b zsh && kiss i zsh
slackpkg install zsh
If you know a platform that is not covered, edit this page and add it!
Homepage — Website — Twitter — Merchandise — Discord