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.20 [https://asciidoctor.org] Runtime Environment (ruby 3.1.2p20 [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.20 [https://asciidoctor.org] Runtime Environment (ruby 3.1.2p20 [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.20 [https://asciidoctor.org] Runtime Environment (ruby 3.1.2p20 [x86_64-linux]) (lc:UTF-8 fs:UTF-8 in:- ex:UTF-8)
pacman (Arch Linux)
To install the gem on Arch Linux-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.20 [https://asciidoctor.org] Runtime Environment (ruby 3.1.2p20 [x86_64-linux]) (lc:UTF-8 fs:UTF-8 in:- ex:UTF-8)
Upgrade 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
Uninstall on Linux
To uninstall (i.e., remove) Asciidoctor using Linux packaging, you request your package manager to remove the Asciidoctor package. The package manager will take care of removing all the necessary application files.
APT
On Debian and Debian-based distributions, uninstall the Asciidoctor package using:
$ sudo apt-get remove -y asciidoctor