In this article, we will see how to uninstall zsh shell from Linux in 2 Easy Steps. ZSH, also known as Z shell is a Unix based interactive shell or command line interpreter used to run Unix/Linux based commands and shell scripts. It is a default login shell for macOS based Systems. It is also very famously used in Linux systems as well but it is not the default shell of most of the Linux distributions. Anyone want to use this shell in a Linux system would need to install it from either its default repo or from the official download page.
Sometime you might want to install the shell for some specific tasks and once it is over you would like to uninstall it again as it serves no other purpose. So here we will see all the methods through which you can uninstall zsh shell from your Linux system.
How to uninstall zsh shell from Linux in 2 Easy Steps
Also Read: Solved "zsh: command not found: pip" in Linux/macOS
Step 1: Prerequisites
a) You should have a running Linux
Server.
b) You should have sudo
or root
access to run privileged commands.
c) You should have a package manager installed in your Server.
Step 2: Uninstall ZSH
You can use different methods to uninstall zsh shell from your system depending on the Linux distribution you are currently using.
a) Using dnf or yum
If you are looking to uninstall zsh from RHEL/CentOS based systems then you need to run sudo dnf remove zsh
command as shown below.
[cyberithub@centos8]~% sudo dnf remove zsh Modular dependency problems: Problem 1: conflicting requests - nothing provides module(perl:5.26) needed by module perl-DBD-SQLite:1.58:8030020200716174729:3a70019f.x86_64 Problem 2: conflicting requests - nothing provides module(perl:5.26) needed by module perl-DBI:1.641:8030020200716150652:1e4bbb35.x86_64 Problem 3: conflicting requests - nothing provides module(perl:5.26) needed by module perl-IO-Socket-SSL:2.066:8030020201222215140:1e4bbb35.x86_64 Problem 4: conflicting requests - nothing provides module(perl:5.26) needed by module perl-libwww-perl:6.34:8030020201223164340:b967a9a2.x86_64 Dependencies resolved. ============================================================================================================================================================= Package Architecture Version Repository Size ============================================================================================================================================================= Removing: zsh x86_64 5.5.1-6.el8_1.2 @baseos 7.2 M Transaction Summary ============================================================================================================================================================= Remove 1 Package Freed space: 7.2 M Is this ok [y/N]: y Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Running scriptlet: zsh-5.5.1-6.el8_1.2.x86_64 1/1 Erasing : zsh-5.5.1-6.el8_1.2.x86_64 1/1 Running scriptlet: zsh-5.5.1-6.el8_1.2.x86_64 1/1 Verifying : zsh-5.5.1-6.el8_1.2.x86_64 1/1 Removed: zsh-5.5.1-6.el8_1.2.x86_64 Complete!
If you are having yum utility then you can use that as well to remove zsh package from your System. You just need to run sudo yum remove zsh
command as shown below.
[cyberithub@centos7 ~]$ sudo yum remove zsh Modular dependency problems: Problem 1: conflicting requests - nothing provides module(perl:5.26) needed by module perl-DBD-SQLite:1.58:8030020200716174729:3a70019f.x86_64 Problem 2: conflicting requests - nothing provides module(perl:5.26) needed by module perl-DBI:1.641:8030020200716150652:1e4bbb35.x86_64 Problem 3: conflicting requests - nothing provides module(perl:5.26) needed by module perl-IO-Socket-SSL:2.066:8030020201222215140:1e4bbb35.x86_64 Problem 4: conflicting requests - nothing provides module(perl:5.26) needed by module perl-libwww-perl:6.34:8030020201223164340:b967a9a2.x86_64 Dependencies resolved. ============================================================================================================================================================= Package Architecture Version Repository Size ============================================================================================================================================================= Removing: zsh x86_64 5.5.1-6.el8_1.2 @baseos 7.2 M Transaction Summary ============================================================================================================================================================= Remove 1 Package Freed space: 7.2 M Is this ok [y/N]: y Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Running scriptlet: zsh-5.5.1-6.el8_1.2.x86_64 1/1 Erasing : zsh-5.5.1-6.el8_1.2.x86_64 1/1 Running scriptlet: zsh-5.5.1-6.el8_1.2.x86_64 1/1 Verifying : zsh-5.5.1-6.el8_1.2.x86_64 1/1 Removed: zsh-5.5.1-6.el8_1.2.x86_64 Complete!
b) Using apt or apt-get
If you are looking to uninstall zsh from a Ubuntu/Debian/Linux Mint based systems, then you need to use sudo apt remove zsh
or sudo apt-get remove zsh
command as shown below.
cyberithub@ubuntu:~$ sudo apt remove zsh [sudo] password for cyberithub: Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: libexpat1-dev libfwupdplugin1 libllvm11 libpython3-dev libpython3.8-dev libxmlb1 python-pip-whl python3-dev python3-wheel python3.8-dev zlib1g-dev zsh-common Use 'sudo apt autoremove' to remove them. The following packages will be REMOVED: zsh 0 upgraded, 0 newly installed, 1 to remove and 28 not upgraded. After this operation, 2,390 kB disk space will be freed. Do you want to continue? [Y/n] y (Reading database ... 204406 files and directories currently installed.) Removing zsh (5.8-3ubuntu1.1) ... Processing triggers for man-db (2.9.1-1) ...
In case, if you want to remove the configuration files along with the package then you need to run sudo apt remove zsh --purge
command as shown below.
cyberithub@ubuntu:~$ sudo apt remove zsh --purge Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: libexpat1-dev libfwupdplugin1 libllvm11 libpython3-dev libpython3.8-dev libxmlb1 python-pip-whl python3-dev python3-wheel python3.8-dev zlib1g-dev zsh-common Use 'sudo apt autoremove' to remove them. The following packages will be REMOVED: zsh* 0 upgraded, 0 newly installed, 1 to remove and 28 not upgraded. After this operation, 0 B of additional disk space will be used. Do you want to continue? [Y/n] Y (Reading database ... 204349 files and directories currently installed.) Purging configuration files for zsh (5.8-3ubuntu1.1) ...