How to Uninstall Oh My Zsh (Step-by-Step)
This guide walks you through completely removing Oh My Zsh from your system, restoring your shell to its previous state. You’ll learn how to uninstall the framework, revert to your original shell configuration, and ensure no leftover files remain.
What You’ll Need
- Access to a terminal window (you’re already using Zsh if Oh My Zsh is installed).
- Basic familiarity with the command line — you’ll be running a few commands.
- Your original
.zshrcfile, if you backed it up before installing Oh My Zsh. If not, don’t worry — the uninstaller will create a backup.
Step-by-Step
- Open your terminal. You can use any terminal emulator; the commands work the same in iTerm2, GNOME Terminal, Konsole, or the default macOS Terminal.
- Run the uninstall script. Oh My Zsh includes an uninstall script that removes the framework and restores your previous
.zshrc. Type the following and press Enter:env ZSH=$ZSH sh $ZSH/tools/uninstall.sh
If you installed Oh My Zsh in a custom location, replace$ZSHwith that path. - Confirm the removal. The script will ask for confirmation. Type
yand press Enter. It will then remove the.oh-my-zshdirectory and restore your backup.zshrcif one exists. - Check your shell. After the script finishes, your current terminal session may still be using Zsh. To switch back to your previous shell (usually Bash), run:
chsh -s $(which bash)
On macOS, you might need to specify the full path, e.g.,chsh -s /bin/bash. You’ll be prompted for your password. - Restart your terminal. Close and reopen your terminal window (or open a new tab). You should now see your original shell prompt without Oh My Zsh theming or plugins.
- Verify the removal. Run
echo $ZSH— it should return nothing or an empty line. Also check that~/.oh-my-zshno longer exists withls -la ~ | grep oh-my-zsh(no output means it’s gone). - Clean up any leftover files (optional). If you had custom themes or plugins, they might be in
~/.oh-my-zsh/custom. The uninstaller removes the whole directory, so nothing should remain. However, if you manually created files elsewhere, delete them as needed.
Common Mistakes
- Skipping the backup: The uninstaller restores your original
.zshrconly if it was saved during installation. If you didn’t have a backup, the script creates one from your current.zshrc(which may contain Oh My Zsh settings). You’ll need to manually edit it to remove Oh My Zsh lines. - Not changing the default shell: Uninstalling Oh My Zsh doesn’t change your default shell. If you’re still in Zsh after uninstalling, you’ll see a bare Zsh prompt, not Bash. Use
chshto switch back. - Forgetting to restart the terminal: Changes won’t take effect until you start a new session. Simply opening a new tab is enough.
- Using the wrong path: If you installed Oh My Zsh with a custom
$ZSHvariable, the default uninstall command may fail. Always use the correct path.
Tips
- Back up your
.zshrcbefore uninstalling: Even though the script creates a backup, it’s safer to manually copy your current.zshrcto~/.zshrc.backupjust in case. - If you plan to reinstall later: Keep a list of your favorite plugins and themes. You can reinstall Oh My Zsh and quickly reconfigure it.
- After switching to Bash, your
.bashrcor.bash_profilewill be used. If you had aliases or functions in Zsh, you’ll need to migrate them manually. - On macOS, the default shell changed to Zsh in Catalina (10.15). If you’re on a newer version, switching back to Bash might require installing an older version, as macOS ships Bash 3.2. Consider if you really want to leave Zsh.
Troubleshooting
- The uninstall script says “command not found” or “No such file or directory”: This usually means
$ZSHis not set. Check withecho $ZSH. If it’s empty, find your Oh My Zsh installation withfind ~ -name "oh-my-zsh" -type dand use that path in the command. - After uninstalling, my terminal still shows Oh My Zsh themes: This happens if the uninstall script didn’t restore your
.zshrcproperly. Open~/.zshrcand remove any lines that reference Oh My Zsh (likesource $ZSH/oh-my-zsh.sh). Then restart the terminal. - I can’t change my default shell with
chsh: On some systems, you may need to specify the full path to the shell. Also, ensure the shell is listed in/etc/shells. If not, add it withsudo(e.g.,echo /bin/bash | sudo tee -a /etc/shells). - My terminal opens with a “command not found: compinit” error: This is a leftover from Zsh’s completion system. After removing Oh My Zsh, your
.zshrcmight still haveautoload -U compinit && compinitlines. Remove them or replace with a clean.zshrc. - I accidentally deleted my
.zshrc: The uninstaller backs it up to~/.zshrc.bak(or similar). Check for that file. If it’s gone, you can start fresh with a minimal.zshrcor copy the system default from/etc/skel/.zshrcon Linux.
Frequently Asked Questions
Will uninstalling Oh My Zsh delete my custom aliases?
Yes, if they were defined in your .zshrc or in Oh My Zsh’s custom files. The uninstaller restores your original .zshrc (from before installation), so aliases you added after installing Oh My Zsh will be lost. Always back up your current .zshrc first.
Do I need to uninstall Zsh itself?
No. Oh My Zsh is just a framework that enhances Zsh. Uninstalling it leaves Zsh installed. If you want to remove Zsh entirely, you’d need to uninstall it via your package manager, but that’s separate and usually not necessary.
Can I reinstall Oh My Zsh after uninstalling?
Yes, absolutely. Just run the official installer script again. Your previous configuration will be gone, but you can set it up fresh.
What happens to my plugins and themes?
They are removed along with the ~/.oh-my-zsh directory. If you had custom plugins outside that directory, they remain, but they won’t be loaded without Oh My Zsh.
Is it safe to uninstall Oh My Zsh?
Yes, it’s safe. The uninstaller only removes files related to Oh My Zsh and restores your previous shell configuration. Your personal files and other applications are not affected.
Why is my terminal still using Zsh after uninstalling?
Because your default shell is still set to Zsh. You need to change it with chsh to Bash (or another shell) and restart your terminal.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.