Install Using Linux Packaging

The benefit of using your operating system’s package manager to install the gem is that it handles installing Ruby and the RubyGems library if those packages are not already installed on your machine.

Package versions

The version of Asciidoctor installed by the package manager may not match the latest release of Asciidoctor. Consult the package repository for your distribution to find out which version is packaged per distribution release.

If you want to use a version of Asciidoctor that is newer than what is available via your package manager, see Install Using Ruby Packaging.

APT

On Debian and Debian-based distributions such as Ubuntu, use APT to install Asciidoctor. To install the package, open a terminal and type:

$ sudo apt-get install -y asciidoctor

If the gem installed successfully, Asciidoctor’s command line interface (CLI) will be available on your PATH. To confirm that Asciidoctor is available, execute:

$ asciidoctor --version

You should see information about the Asciidoctor version and your Ruby environment printed in the terminal.

Asciidoctor 2.0.15 [https://asciidoctor.org]
Runtime Environment (ruby 3.0.2p107 [x86_64-linux]) (lc:UTF-8 fs:UTF-8 in:- ex:UTF-8)

DNF

On RPM-based Linux distributions, such as Fedora, CentOS, and RHEL, use the DNF package manager to install Asciidoctor. To install the package, open a terminal and type:

$ sudo dnf install -y asciidoctor

If the gem installed successfully, Asciidoctor’s command line interface (CLI) will be available on your PATH. To confirm that Asciidoctor is available, execute:

$ asciidoctor --version

You should see information about the Asciidoctor version and your Ruby environment printed in the terminal.

Asciidoctor 2.0.15 [https://asciidoctor.org]
Runtime Environment (ruby 3.0.2p107 [x86_64-linux]) (lc:UTF-8 fs:UTF-8 in:- ex:UTF-8)

apk (Alpine Linux)

To install the gem on Alpine Linux, open a terminal and type:

$ sudo apk add asciidoctor

If the gem installed successfully, Asciidoctor’s command line interface (CLI) will be available on your PATH. To confirm that Asciidoctor is available, execute:

$ asciidoctor --version

You should see information about the Asciidoctor version and your Ruby environment printed in the terminal.

Asciidoctor 2.0.15 [https://asciidoctor.org]
Runtime Environment (ruby 3.0.2p107 [x86_64-linux]) (lc:UTF-8 fs:UTF-8 in:- ex:UTF-8)

pacman (Arch Linux)

To install the gem on Arch-based distributions, open a terminal and type:

$ sudo pacman -S asciidoctor

If the gem installed successfully, Asciidoctor’s command line interface (CLI) will be available on your PATH. To confirm that Asciidoctor is available, execute:

$ asciidoctor --version

You should see information about the Asciidoctor version and your Ruby environment printed in the terminal.

Asciidoctor 2.0.15 [https://asciidoctor.org]
Runtime Environment (ruby 3.0.2p107 [x86_64-linux]) (lc:UTF-8 fs:UTF-8 in:- ex:UTF-8)

Upgrading on Linux

Some Linux distributions may not have the latest stable version of Asciidoctor packaged immediately after a release of a new gem. If you need to upgrade to the latest version immediately, use gem install instead of the package manager.

Your Linux system may be configured to automatically update packages, in which case the latest Asciidoctor package will be installed as soon as it becomes available. No further action is required by you.

APT

On Debian and Debian-based distributions, update the Asciidoctor package using:

$ sudo apt-get upgrade -y asciidoctor

DNF

On Fedora and other RPM-based distributions, you can update the package using:

$ sudo dnf update -y asciidoctor

apk (Alpine Linux)

On Alpine Linux, update the Asciidoctor package using:

$ sudo apk add -u asciidoctor