How to Install Zsh on Fedora Linux

Zsh (Z Shell) offers intelligent tab completion, shared command history across terminal sessions, and a plugin ecosystem that transforms daily command-line workflows. Whether you’re managing Git repositories, navigating complex directory structures, or automating repetitive tasks, Zsh adapts to your working style. This guide covers installing Zsh on Fedora, setting it as your default shell, configuring initial settings, and optionally extending it with Oh My Zsh alongside popular plugins for auto-suggestions and syntax highlighting.

Choose Your Zsh Setup Method for Fedora

Zsh is available in Fedora’s default repositories. The setup complexity depends on how much customization you need:

MethodChannelVersionUpdatesBest For
Basic ZshFedora ReposStableAutomatic via DNFUsers who want a better shell without plugins
Zsh + DNF PluginsFedora ReposStableAutomatic via DNFUsers who prefer system package management
Zsh + Oh My ZshOh My Zsh GitHubLatestManual via omz updateUsers who want extensive customization

For most users, Oh My Zsh provides the best experience with its curated framework for managing themes and plugins. If you prefer system-managed packages or want minimal external dependencies, the DNF plugins method delivers auto-suggestions and syntax highlighting without third-party install scripts.

Install Zsh

Install Zsh from Fedora’s default repositories:

sudo dnf install zsh -y

Verify the installation by checking the installed version:

zsh --version

Expected output:

zsh 5.9 (x86_64-redhat-linux-gnu)

Run the Initial Configuration Wizard

When you first start Zsh without a ~/.zshrc file, a configuration wizard launches automatically. If a configuration file already exists or you previously completed the wizard, Zsh skips directly to the shell prompt.

Start Zsh manually to trigger the wizard:

zsh

The wizard offers several configuration options:

  • Press q: Exit without creating a configuration file. The wizard appears again next time you start Zsh.
  • Press 0: Create an empty ~/.zshrc file. Select this if you want full control or plan to install Oh My Zsh, which provides its own configuration template.
  • Press 1: Open the main menu to configure history, completion, key bindings, and other settings interactively.
  • Press 2: Create a ~/.zshrc with recommended defaults. This works well for users who want a functional configuration immediately.

If you plan to install Oh My Zsh later, any option works because the framework backs up and replaces the configuration file during installation.

Set Zsh as Default Shell

Use chsh to change your login shell to Zsh:

chsh -s $(which zsh)

Enter your password when prompted. The change takes effect after you log out and log back in, or start Zsh manually in the current session:

zsh

After logging out and back in, verify Zsh is your default shell:

echo $SHELL

Expected output:

/usr/bin/zsh

Install Plugins via DNF (Optional)

Fedora packages two essential Zsh plugins in its default repositories. This method provides system-managed updates through DNF without requiring manual Git cloning or external install scripts:

sudo dnf install zsh-autosuggestions zsh-syntax-highlighting -y

These packages install to /usr/share/ and must be sourced in your configuration file. Add the following lines to ~/.zshrc:

echo 'source /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh' >> ~/.zshrc
echo 'source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh' >> ~/.zshrc

Apply the changes immediately:

source ~/.zshrc

Alternatively, open a new terminal window for the changes to take effect automatically.

How the Plugins Work

Auto-suggestions display commands from your history as faded text while you type. Press the right arrow key or End to accept the full suggestion, or press Ctrl+Right Arrow to accept one word at a time.

Syntax highlighting colors your command line in real time: valid commands appear green, unknown commands appear red, and file paths change color based on whether the file exists.

Install Oh My Zsh (Optional)

Oh My Zsh is a community-driven framework that simplifies Zsh configuration with over 300 bundled plugins and 150 themes. The framework requires Git installed on Fedora and either curl or wget.

Install Prerequisites

Ensure Git and curl are installed before running the installer:

sudo dnf install git curl -y

Run the Installer

Download and execute the Oh My Zsh installation script:

sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

The script backs up your existing ~/.zshrc to ~/.zshrc.pre-oh-my-zsh and creates a new configuration file. If prompted to change your default shell, enter y if you skipped that step earlier.

If the installer times out or fails to connect, some networks block raw.githubusercontent.com. Use the mirror URL instead: sh -c "$(curl -fsSL https://install.ohmyz.sh)"

Example output:

Looking for an existing zsh config...
Found ~/.zshrc. Backing up to ~/.zshrc.pre-oh-my-zsh
Using the Oh My Zsh template file and adding it to ~/.zshrc.
         __                                     __
  ____  / /_     ____ ___  __  __   ____  _____/ /_
 / __ \/ __ \   / __ `__ \/ / / /  /_  / / ___/ __ \
/ /_/ / / / /  / / / / / / /_/ /    / /_(__  ) / / /
\____/_/ /_/  /_/ /_/ /_/\__, /    /___/____/_/ /_/
                        /____/

Oh My Zsh is now installed!

Enable Popular Plugins

Oh My Zsh manages plugins through the plugins array in ~/.zshrc. Clone the auto-suggestions and syntax highlighting plugins into the custom plugins directory:

git clone --depth 1 https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone --depth 1 https://github.com/zsh-users/zsh-syntax-highlighting ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

The --depth 1 flag downloads only the latest version without the full Git history, which saves bandwidth and disk space.

Open the configuration file to enable the plugins:

nano ~/.zshrc

Find the line starting with plugins=( and add the new plugins:

plugins=(git zsh-autosuggestions zsh-syntax-highlighting)

Save the file with Ctrl+O, press Enter, then exit with Ctrl+X. Apply the changes:

source ~/.zshrc

Change the Theme

Oh My Zsh includes over 150 themes. View the available options in the theme gallery. To change themes, edit ~/.zshrc and modify the ZSH_THEME line:

ZSH_THEME="agnoster"

Some themes like agnoster and powerlevel10k require powerline fonts for special characters to display correctly. Install them with: sudo dnf install powerline-fonts

Apply the new theme:

source ~/.zshrc

Troubleshooting Common Zsh Issues

If you encounter problems with your Zsh installation, check these common solutions.

Default Shell Not Changing

If echo $SHELL still shows /bin/bash after running chsh, verify Zsh appears in the authorized shells file:

grep zsh /etc/shells

Expected output:

/usr/bin/zsh
/bin/zsh

If Zsh is not listed, add it manually:

echo "$(which zsh)" | sudo tee -a /etc/shells

Run chsh -s $(which zsh) again and log out completely. A full logout is required because the shell assignment is read at login time, not when opening new terminals.

Slow Startup Time

If Zsh takes several seconds to start, the configuration file may contain slow operations. Profile the startup time:

time zsh -i -c exit

A healthy startup time is under 0.5 seconds. Common causes include network-dependent scripts, excessive plugins, or NFS-mounted home directories. Temporarily rename ~/.zshrc to test with a minimal configuration:

mv ~/.zshrc ~/.zshrc.bak
time zsh -i -c exit

If startup improves, re-enable sections of your configuration file incrementally to find the culprit.

Missing Special Characters in Prompt

If your prompt displays boxes or question marks instead of arrows or Git symbols, install powerline fonts:

sudo dnf install powerline-fonts -y

After installation, restart your terminal or log out and back in for the fonts to take effect.

Plugins Not Loading

If auto-suggestions or syntax highlighting do not work after enabling them, verify the plugin files exist:

ls ~/.oh-my-zsh/custom/plugins/

Expected output for Oh My Zsh plugins:

example  zsh-autosuggestions  zsh-syntax-highlighting

If the plugin directories are missing, re-run the git clone commands from the plugin installation section. Also verify the plugin names in ~/.zshrc match exactly (case-sensitive). Check your current plugins setting:

grep "^plugins=" ~/.zshrc

For DNF-installed plugins, verify the source files exist:

ls /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh
ls /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

If these files exist but plugins still do not work, ensure your ~/.zshrc contains the source lines at the end of the file, after any other configuration.

Update Zsh

Zsh and DNF-installed plugins receive updates through the standard system update process:

sudo dnf upgrade --refresh

To update only Zsh and related packages without upgrading the entire system:

sudo dnf upgrade zsh zsh-autosuggestions zsh-syntax-highlighting

Update Oh My Zsh

Oh My Zsh includes a built-in update command that pulls the latest version from GitHub:

omz update

To update the custom plugins you installed via Git, navigate to each plugin directory and pull the latest changes:

git -C ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions pull
git -C ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting pull

After updating, reload your configuration to apply any changes:

source ~/.zshrc

Remove Zsh

To completely remove Zsh and return to Bash, follow these steps.

Restore Bash as Default Shell

Change your default shell back to Bash before uninstalling Zsh:

chsh -s $(which bash)

Uninstall Packages

Remove Zsh and any plugins installed via DNF:

sudo dnf remove zsh zsh-autosuggestions zsh-syntax-highlighting -y

Remove Configuration Files

The following commands permanently delete your Zsh configuration and Oh My Zsh installation. If you have custom aliases, functions, or other settings you want to keep, back up ~/.zshrc before proceeding.

rm -rf ~/.oh-my-zsh ~/.zcompdump*
rm -f ~/.zshrc ~/.zshrc.pre-oh-my-zsh ~/.zsh_history

Log out and log back in to complete the transition to Bash. Verify you are back on Bash:

echo $SHELL

Expected output:

/bin/bash

Common Questions

Does Fedora include Zsh plugins in its default repositories?

Yes. Fedora packages zsh-autosuggestions and zsh-syntax-highlighting in its official repositories. Install them with dnf install zsh-autosuggestions zsh-syntax-highlighting and source them in your ~/.zshrc. This provides system-managed updates without requiring Git clones or third-party frameworks.

Should I use DNF plugins or Oh My Zsh on Fedora?

Both work well. DNF plugins integrate with Fedora’s package manager for automatic updates and require no external dependencies. Oh My Zsh provides a larger ecosystem with 300+ plugins, themes, and Git integration out of the box. Choose DNF plugins for minimal setups or Oh My Zsh for extensive customization.

Can I run both DNF plugins and Oh My Zsh together?

Not recommended. If you install Oh My Zsh, use its plugin system instead of sourcing DNF-installed plugins. Mixing both can cause duplicate plugin loading, slower shell startup, and configuration conflicts. Choose one approach and stick with it.

Conclusion

You now have Zsh installed and configured as your default shell on Fedora. Whether you chose the DNF-based plugin approach or the full Oh My Zsh framework, your terminal now offers intelligent auto-suggestions, real-time syntax highlighting, and extensive customization options. The configuration file at ~/.zshrc controls everything from prompt appearance to plugin behavior and custom aliases.

Explore the Oh My Zsh plugin directory for additional productivity tools including Git integration, Docker shortcuts, kubectl aliases, and language-specific helpers for Python, Node.js, and Go development workflows. For an enhanced terminal editing experience, consider pairing Zsh with Neovim on Fedora.

Leave a Comment

Let us know you are human: