Install qrtool on Ubuntu 26.04

Install qrtool on Ubuntu 26.04

The qrtool is a command-line utility for generating and reading QR codes. It enables quick encoding of text into QR images as well as decoding existing QR files directly from the terminal. This tutorial shows how to install qrtool on Ubuntu 26.04.

Install qrtool

Fetch the latest available release number from the official repository:

QRTOOL_VERSION=$(curl -s "https://api.github.com/repos/sorairolake/qrtool/releases/latest" | grep -Po '"tag_name": "v\K[0-9.]+')

Download the appropriate archive:

curl -sSLo qrtool.tar.gz https://github.com/sorairolake/qrtool/releases/latest/download/qrtool-v$QRTOOL_VERSION-x86_64-unknown-linux-musl.tar.gz

Prepare a temporary directory and extract the package contents:

mkdir qrtool-temp
tar xf qrtool.tar.gz --strip-components=1 -C qrtool-temp

Place the executable in a directory accessible via the system PATH:

sudo mv qrtool-temp/qrtool /usr/local/bin

Confirm that the installation succeeded by checking the qrtool version:

qrtool --version

Clean up unneeded installation files:

rm -rf qrtool.tar.gz qrtool-temp

Testing qrtool

Create a QR code image from a text string:

qrtool encode "Hello world" -o test.png

Decode the generated QR code:

qrtool decode test.png

Uninstall qrtool

If qrtool is no longer needed, execute the following command to remove it:

sudo rm -rf /usr/local/bin/qrtool

Leave a Comment

Cancel reply

Your email address will not be published.