How To Install Zsh on Rocky Linux 10

Install Zsh on Rocky Linux 10

Bash is the default shell on Rocky Linux 10, and it works. But if you spend serious time inside a terminal — managing servers, running scripts, or doing development work — Bash’s limitations show up quickly. If you want to install Zsh on Rocky Linux 10, this guide walks you through everything: installing the package via DNF, setting Zsh as your default login shell, adding Oh My Zsh, and layering in the plugins that actually change how your terminal feels day-to-day.

Zsh (Z Shell) is a POSIX-compliant interactive shell built for people who live in the terminal. It combines the best features of Bash, ksh, and tcsh into one shell, adds smart tab completion, real-time syntax highlighting, and inline history suggestions. Rocky Linux 10.1 ships Zsh 5.9 in its default repositories, which means you do not need to add any third-party repos or enable EPEL to get started.

This guide was tested on Rocky Linux 10.1 in April 2026 with Zsh 5.9 and Oh My Zsh on the master branch.

Prerequisites

Before you start, make sure you have the following:

  • Operating System: Rocky Linux 10 or 10.1 (bare metal, VM, or cloud instance)
  • User Privileges: A user account with sudo access or direct root access
  • Internet Access: Required for DNF package download and Oh My Zsh installation
  • Terminal Access: SSH or direct console access to the server
  • Basic Shell Knowledge: Familiarity with running commands in a Linux terminal

No additional repositories are needed. Zsh, Git, and Curl are all available in the default Rocky Linux 10 BaseOS and AppStream repositories.

What Is Zsh and Why Should You Use It on Rocky Linux 10?

Before jumping into the installation, it helps to understand what you are actually getting.

Zsh was created by Paul Falstad in 1990 at Princeton University. It has been actively developed for over 30 years and became the default shell on macOS with the release of Catalina in 2019, which tells you a lot about where the industry puts its trust.

On a Rocky Linux 10 server, the gap between Bash and Zsh becomes obvious once you start working with complex commands, long file paths, and multi-step pipelines. Here is how they compare on the features that matter most for sysadmins and developers:

Feature Bash 5.x Zsh 5.9
Tab Completion Basic Smart, context-aware
Inline History Suggestions No Yes (via plugin)
Real-Time Syntax Highlighting No Yes (via plugin)
Globbing (e.g., **/*.log) No (needs find) Native support
Plugin Ecosystem Limited 300+ plugins via Oh My Zsh
Theme Support Minimal 150+ built-in themes
Config File .bashrc .zshrc

One important point: switching to Zsh does not break your existing Bash scripts. Bash scripts still run under Bash; Zsh only replaces the interactive shell you work in.

Why Rocky Linux 10 Specifically?

Rocky Linux 10 is a production-grade, RHEL-compatible operating system designed for stability. Because Zsh is available in the default DNF repositories, any security updates for Zsh flow through the standard Rocky Linux update channel automatically. You get a better shell without compromising the update integrity of your system.

Step 1: Update Your Rocky Linux 10 System

Always update your system before installing new packages. This keeps DNF’s metadata current, resolves potential dependency conflicts, and applies any pending security patches before you add anything new.

Run the update command:

sudo dnf update -y

The -y flag automatically confirms the update. On a fresh system, this can take a few minutes depending on how many packages need updating.

After the update completes, confirm your Rocky Linux version:

cat /etc/rocky-release

Expected output:

Rocky Linux release 10.1 (Blue Onyx)

Once you confirm the system is current, move on to the actual installation.

Step 2: Install Zsh on Rocky Linux 10 via DNF

This is the core step of the guide. You will install Zsh, Git, and Curl together in a single command.

Why Install All Three at Once?

  • Zsh is the shell itself
  • Git is required later to clone Oh My Zsh and the plugin repositories
  • Curl is used by the Oh My Zsh installer script to fetch the setup file

Run the install command:

sudo dnf install -y zsh git curl

DNF resolves all dependencies and pulls the packages from the default Rocky Linux 10 repositories. No EPEL or extra repos needed.

Verify the Zsh Installation

Check the installed version:

zsh --version

Expected output on Rocky Linux 10.1:

zsh 5.9 (x86_64-redhat-linux-gnu)

Confirm the Zsh binary path:

which zsh

Output:

/usr/bin/zsh

Confirm Zsh Is Registered in /etc/shells

The chsh command refuses to accept a shell that is not listed in /etc/shells. The DNF package registers Zsh automatically, but always verify this before proceeding:

grep zsh /etc/shells

Expected output:

/usr/bin/zsh
/bin/zsh

Both paths are listed. If for any reason they are missing, add them manually:

echo /usr/bin/zsh | sudo tee -a /etc/shells

Step 3: Launch Zsh and Explore the Initial Configuration Wizard

Before setting Zsh as your permanent default shell, launch it manually to see the first-run wizard:

zsh

Zsh runs zsh-newuser-install the first time it starts without an existing .zshrc. It presents four options:

  • Option 0: Exit and create an empty .zshrc
  • Option 1: Quit without doing anything
  • Option 2: Populate .zshrc with sensible recommended defaults (best choice for manual setup)
  • Option 4: Exit and let the new user install function handle it

If you plan to install Oh My Zsh (covered in Step 5), you can skip this wizard entirely. Oh My Zsh writes its own .zshrc and overwrites whatever you set here.

Verify the active shell:

echo $0

Output:

zsh

Step 4: Set Zsh as the Default Login Shell

Now make Zsh permanent. The chsh command changes the default login shell registered in /etc/passwd:

sudo chsh -s /usr/bin/zsh $USER

The $USER variable substitutes your current username automatically, avoiding typos.

Verify the Shell Change

Check the passwd entry to confirm the change was saved:

getent passwd $USER

Expected output (the last field is now /usr/bin/zsh):

rocky:x:1000:1000:Cloud User:/home/rocky:/usr/bin/zsh

Apply the Change Without Logging Out

The new default shell only activates on the next login. To switch inside your current session right now:

exec zsh

Verify the active shell:

echo $SHELL

Output:

/usr/bin/zsh

Step 5: Install Oh My Zsh for Full Zsh on Rocky Linux 10 Setup

Oh My Zsh is an open-source, community-maintained framework for managing Zsh configuration. It ships with over 300 plugins and roughly 150 built-in themes, and it adds an auto-update mechanism so you stay current without manual effort.

What the Installer Does

When you run the Oh My Zsh installer, it performs the following steps automatically:

  1. Clones the Oh My Zsh repository to ~/.oh-my-zsh
  2. Backs up your existing ~/.zshrc to ~/.zshrc.pre-oh-my-zsh
  3. Writes a fresh ~/.zshrc that sources the framework
  4. Sets the default theme to robbyrussell

Run the Installer

The --unattended flag is important if you are working over SSH. Without it, the installer waits for interactive input and can hang on sessions without a proper TTY:

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

When it finishes, you will see the Oh My Zsh banner confirming the installation.

Confirm the Installation

Check that your new .zshrc references Oh My Zsh correctly:

head -15 ~/.zshrc

Look for these two lines:

export ZSH="$HOME/.oh-my-zsh"
ZSH_THEME="robbyrussell"

Both lines confirm the framework is wired up and the default theme is active.

Step 6: Add Essential Zsh Plugins

Out of the box, Oh My Zsh activates only the git plugin. Two external plugins make the biggest real-world difference for sysadmins and developers.

Install zsh-autosuggestions

This plugin shows greyed-out command completions pulled from your history as you type. Press the right-arrow key to accept the suggestion. It is one of the highest-impact productivity upgrades available for any shell.

Clone it into the Oh My Zsh custom plugins directory:

git clone https://github.com/zsh-users/zsh-autosuggestions \
  ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions

Install zsh-syntax-highlighting

This plugin colors each command green when the binary exists in your $PATH and red when it does not. You catch typos before pressing Enter instead of after.

Clone it:

git clone https://github.com/zsh-users/zsh-syntax-highlighting \
  ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting

Ordering matters: zsh-syntax-highlighting hooks into the Zsh line editor and must always be the last plugin in your list.

Register All Plugins in .zshrc

Add both plugins, plus two built-in helpers (sudo and history), to the plugins list. The sudo plugin lets you press Escape twice to prepend sudo to your last command. The history plugin adds short aliases (h, hs, hsi) for faster history navigation.

Update the plugins line with sed:

sed -i 's/^plugins=(git)/plugins=(git zsh-autosuggestions sudo history zsh-syntax-highlighting)/' ~/.zshrc

Reload the configuration:

source ~/.zshrc

Verify the plugin list loaded:

grep ^plugins= ~/.zshrc

Output:

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

Step 7: Configure Zsh on Rocky Linux 10 and Verify the Full Stack

Run a self-test in a non-interactive Zsh session to confirm that the theme, plugin list, and version are all loading as expected:

zsh -i -c 'echo THEME=$ZSH_THEME; echo PLUGINS=$plugins; zsh --version'

Expected output:

THEME=robbyrussell
PLUGINS=git zsh-autosuggestions sudo history zsh-syntax-highlighting
zsh 5.9 (x86_64-redhat-linux-gnu)

All three lines confirm your Zsh on Rocky Linux 10 setup is complete and working correctly.

Test your plugins live:

  • Start typing a command you have run before. A greyed suggestion appears to the right of the cursor. Press the right-arrow key to accept it.
  • Type ls and watch it turn green. Type lss and watch it turn red.
  • Press Escape twice after any command to watch sudo get prepended automatically.

After testing, log out and back in to confirm your default shell persists across sessions:

echo $SHELL

Output:

/usr/bin/zsh

Step 8: Customize Your Theme (Bonus Step)

The default robbyrussell theme is clean and minimal. Once you settle in, you may want more information in your prompt — current Git branch, Python virtual environment, exit status, and execution time.

Switch a Built-In Theme

List all available themes:

ls ~/.oh-my-zsh/themes/

Change the theme by editing ~/.zshrc:

nano ~/.zshrc

Find the line ZSH_THEME="robbyrussell" and change the value. For example:

ZSH_THEME="agnoster"

Reload Zsh:

exec zsh

Install Powerlevel10k

Powerlevel10k is the community’s most popular Zsh theme. It is fast, highly configurable, and ships with an interactive wizard that walks you through the setup on first launch.

Install it:

git clone --depth=1 https://github.com/romkatv/powerlevel10k.git \
  ~/.oh-my-zsh/custom/themes/powerlevel10k
sed -i 's/^ZSH_THEME=.*/ZSH_THEME="powerlevel10k\/powerlevel10k"/' ~/.zshrc
exec zsh

The wizard launches automatically and lets you pick prompt style, icon set, and color scheme interactively.

How to Uninstall Zsh from Rocky Linux 10

If you decide Zsh is not for you, cleaning up is straightforward and fully reversible.

Step 1: Remove Oh My Zsh

Oh My Zsh ships its own uninstaller function:

uninstall_oh_my_zsh

This removes the ~/.oh-my-zsh directory and restores the .zshrc backup from before the installation. Your ~/.zsh_history file stays intact.

Step 2: Revert Your Default Shell to Bash

Always revert the shell before removing the package. Removing the Zsh binary while it is still set as your login shell can break future logins:

sudo chsh -s /bin/bash $USER

Step 3: Remove the Zsh Package

sudo dnf remove zsh -y

Confirm it is gone:

zsh --version

Output:

bash: zsh: command not found

Troubleshooting Common Issues

Problem Likely Cause Fix
chsh: PAM authentication failed Running chsh without sudo in a restricted PAM config Use sudo chsh -s /usr/bin/zsh $USER
chsh: /usr/bin/zsh is not listed in /etc/shells DNF package did not auto-register the shell path Run: echo /usr/bin/zsh | sudo tee -a /etc/shells
Oh My Zsh installer hangs over SSH Interactive TTY not available Add --unattended flag to the install command
Plugins not loading after source ~/.zshrc Syntax error in .zshrc or wrong plugin directory name Run zsh -n ~/.zshrc to check for syntax errors
zsh-syntax-highlighting not coloring commands Plugin is not the last item in the plugins=() list Move it to the last position in the list
Default shell reverts after reboot chsh was run without sudo Re-run sudo chsh -s /usr/bin/zsh $USER and verify with getent passwd $USER

Congratulations! You have successfully installed Zsh. Thanks for using this tutorial for installing Zsh on your AlmaLinux OS 10 system. For additional help or useful information, we recommend you check the official Zsh website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!
r00t is a dedicated and highly skilled Linux Systems Administrator with over a decade of progressive experience in designing, deploying, and maintaining enterprise-grade Linux infrastructure. His professional journey began in the telecommunications industry, where early exposure to Unix-based operating systems ignited a deep and enduring passion for open-source technologies and server administration.​ Throughout his career, r00t has demonstrated exceptional proficiency in managing large-scale Linux environments, overseeing more than 300 servers across development, staging, and production platforms while consistently achieving 99.9% system uptime. He holds advanced competencies in Red Hat Enterprise Linux (RHEL), Debian, and Ubuntu distributions, complemented by hands-on expertise in automation tools such as Ansible, Terraform, Bash scripting, and Python.

Related Posts