Fix Ubuntu /bin/sh: 1: zsh: not found error

If you try to move to zsh shell on Ubuntu terminal and you get error /bin/sh: 1: zsh: not found error, then the most common reason will be that you do not have zsh shell installed on your device.

If you will go under /bin folder, you will not find zsh

How to install Zsh on Ubuntu?

Run command: sudo apt install zsh to install zsh

# sudo apt install zsh
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libcap2 libgdbm6 zsh-common
Suggested packages:
  gdbm-l10n zsh-doc
The following NEW packages will be installed:
  libcap2 libgdbm6 zsh zsh-common
0 upgraded, 4 newly installed, 0 to remove and 15 not upgraded.
Need to get 4438 kB of archives.
After this operation, 17.9 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 focal/main arm64 libcap2 arm64 1:2.32-1 [15.5 kB]
Get:2 focal/main arm64 libgdbm6 arm64 1.18.1-5 [26.4 kB]
Get:3 focal/main arm64 zsh-common all 5.8-3ubuntu1 [3744 kB]
Get:4 focal/main arm64 zsh arm64 5.8-3ubuntu1 [653 kB]
Fetched 4438 kB in 4s (1164 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package libcap2:arm64.
(Reading database ... 4245 files and directories currently installed.)
Preparing to unpack .../libcap2_1%3a2.32-1_arm64.deb ...
Unpacking libcap2:arm64 (1:2.32-1) ...
Selecting previously unselected package libgdbm6:arm64.
Preparing to unpack .../libgdbm6_1.18.1-5_arm64.deb ...
Unpacking libgdbm6:arm64 (1.18.1-5) ...
Selecting previously unselected package zsh-common.
Preparing to unpack .../zsh-common_5.8-3ubuntu1_all.deb ...
Unpacking zsh-common (5.8-3ubuntu1) ...
Selecting previously unselected package zsh.
Preparing to unpack .../zsh_5.8-3ubuntu1_arm64.deb ...
Unpacking zsh (5.8-3ubuntu1) ...
Setting up zsh-common (5.8-3ubuntu1) ...
Setting up libcap2:arm64 (1:2.32-1) ...
Setting up zsh (5.8-3ubuntu1) ...
Setting up libgdbm6:arm64 (1.18.1-5) ...
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...

Now try to move to zsh shell and you should get no errors!

# zsh
8d376ec5427e# zsh --version
zsh 5.8 (aarch64-unknown-linux-gnu)
Ubuntu zsh error fix
Copyright © Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap