I’ve been using ZSH for years now as my shell. In that time, I’ve learned a few niceties to make the experience better. Namely, I’ve found the minimal oh-my-zsh prompt keeps out of the way and the git aliases super convenient. Plugins for autosuggestions, like in the fish shell, and syntax highlighting are also quite helpful. Antigen makes keeping plugins up-to-date a breeze.

Tutorial

This tutorial explains how to install ZSH and set it as your default shell on Ubuntu 20.04. Plus, it details how to install and configure Antigen, oh-my-zsh, autosuggestions, and syntax highlighting.

  1. Install ZSH.[1]

    $ sudo apt -y install zsh
  2. Register /usr/bin/zsh as a login shell by adding its path to /etc/shells.

    Debian provides a convenient add-shell command to accomplish this.

    sudo add-shell /usr/bin/zsh
  3. Set the default shell to zsh.

    $ chsh -s `which zsh`
    Changing shell for jordan.
    Password:
    Shell changed.
  4. Now, open up a fresh terminal session to start using .

  5. Download and install Antigen.[2] There is a bug in the debian package at this time, so manually download and install it.[3]

    $ wget -q git.io/antigen
    $ sudo mkdir /usr/share/zsh-antigen
    $ sudo mv antigen /usr/share/zsh-antigen/antigen.zsh

    When the bug is fixed, you can simply install the package with Aptitude as follows.

    $ sudo apt -y install zsh-antigen
  6. Create the .antigenrc configuration file.[4]

    ~/.antigenrc
    # Load the oh-my-zsh library
    antigen use oh-my-zsh
    
    antigen bundles <<EOBUNDLES
        # Bundles from the default repo (robbyrussell's oh-my-zsh)
        git
    
        # Fish-like auto suggestions
        zsh-users/zsh-autosuggestions
    
        # Extra zsh completions
        zsh-users/zsh-completions
    
        # Syntax highlighting bundle.
        zsh-users/zsh-syntax-highlighting
    EOBUNDLES
    
    # Load the theme
    antigen theme robbyrussell
    
    # Tell antigen that you're done
    antigen apply
  7. Now, from the .zshrc file load Antigen and the .antigenrc configuration file.

    ~/.zshrc
    # Load Antigen
    source /usr/share/zsh-antigen/antigen.zsh
    
    # Load Antigen configurations
    antigen init ~/.antigenrc
  8. Load the updated .zshrc configuration file.

    $ source ~/.zshrc
  9. Update the plugins as needed.[5]

    $ antigen update

Conclusion

You should now be able to install and configure ZSH as your default shell in Ubuntu. You should also be able to setup Antigen to use oh-my-zsh and a couple of convenient plugins. If you want to automate updating your Antigen plugins with systemd, checkout the post Automatically Update Antigen.


3. There is also an Ubuntu bug report and an Antigen bug report.