Pandoc is a versatile document conversion utility that supports a wide range of markup and document formats, including Markdown, HTML, LaTeX, DOCX, EPUB, and PDF. It is widely used for converting documentation, generating reports, and automating document workflows. This tutorial explains how to install Pandoc on Ubuntu 26.04.
Install Pandoc
Retrieve the latest Pandoc release number from GitHub:
PANDOC_VERSION=$(curl -s "https://api.github.com/repos/jgm/pandoc/releases/latest" | grep -Po '"tag_name": "\K[0-9.]+')
Download the latest release archive and extract the executable files into the system path:
curl -sSL https://github.com/jgm/pandoc/releases/latest/download/pandoc-$PANDOC_VERSION-linux-amd64.tar.gz \
| sudo tar xz --strip-components=1 -C /usr/local --wildcards '*/bin'
This installation provides the pandoc, pandoc-lua, and pandoc-server executables. Verify that Pandoc has been installed correctly by checking its version:
pandoc --version
Testing Pandoc
Create a sample Markdown file:
nano test.md
Insert the following content:
# My Project
This is a simple Markdown test document.
## Features
Here is the list of features.
Convert the Markdown document into an HTML file:
pandoc test.md -o output.html
The generated HTML will contain content similar to the following:
<h1 id="my-project">My Project</h1>
<p>This is a simple Markdown test document.</p>
<h2 id="features">Features</h2>
<p>Here is the list of features.</p>
Uninstall Pandoc
If Pandoc is no longer required, remove the installed executables from the system:
sudo rm -rf /usr/local/bin/pandoc*
If the user-specific Pandoc data directory is no longer needed, remove it as well:
rm -rf ~/.local/share/pandoc
Leave a Comment
Cancel reply