Knowledgebase

How to Compile Brotli Compression Tool from Source on Debian 9?

Brotli is a generic-purpose lossless compression algorithm that compresses data using a combination of a modern variant of the LZ77 algorithm, Huffman coding, and 2nd order context modeling, with a compression ratio comparable to the best currently available general-purpose compression methods. It is similar in speed with deflate but offers more dense compression. It is open-sourced under the MIT License. You can browse its source code on Github. The specification of the Brotli Compressed Data Format is defined in RFC 7932. This tutorial shows how to compile Brotli compression library from source on Fedora 29 system.

Requirements

  • Fedora 29 system.
  • Non-root user with sudo access.

Initial steps

Check the Fedora version:

lsb_release -ds

# Debian GNU/Linux 9.6 (stretch)

Set up the timezone:

sudo dpkg-reconfigure tzdata

Update your operating system packages:

sudo apt update && sudo apt upgrade -y

Build Brotli

Install build tools and required packages. :

sudo apt install -y build-essential gcc make bc sed autoconf automake libtool git apt-transport-https tree

Clone Brotli repository:

git clone https://github.com/google/brotli.git

Navigate to Brotli source tree directory:

cd brotli

Create a manual page for Brotli command:

sudo cp ~/brotli/docs/brotli.1 /usr/share/man/man1 && sudo gzip /usr/share/man/man1/brotli.1

Check the man page:

man brotli

To generate Autotools configure file run ./bootstrap command first.configure file run ./bootstrap command first:

./bootstrap

After the above command, you should have access to the usual C program build steps: configuremake and make install available.

For help, you can run ./configure --help command. Now we are ready to build Brotli with the following instructions.

The basic commands to build and install brotli are:

./configure --prefix=/usr \
            --bindir=/usr/bin \
            --sbindir=/usr/sbin \
            --libexecdir=/usr/lib64/brotli \
            --libdir=/usr/lib64/brotli \
            --datarootdir=/usr/share \
            --mandir=/usr/share/man/man1 \
            --docdir=/usr/share/doc

make
sudo make install

After the successful build process, you can check Brotli version:

brotli --version
# brotli 1.0.7

To see help about brotli command, you can run:

brotli -h

That's it. You have successfully compiled Brotli from source code.

  • Compile Brotli Compression Tool from Source on Debian, Brotli Compression Tool, Brotli
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to Configure Disk Quota on Ubuntu Server

Disk quotas can be used to limit the amount of disk space or the number of files allocated to a...

create a local Ubuntu repository, update/upgrade distros ‘locally’ and thereby save bandwidth

At work we use only Linux and all our workstations are powered by Ubuntu. Being admin’s, we are...

How to list all unmounted partition of a harddisk in centos/ubuntu?

To address the listing of the unmounted partitions part, there are several ways - lsblk, fdisk,...

How to install Jenkins on Ubuntu 16.04?

Jenkins is an open source automation server written in Java. Jenkins helps to automate the...

How to install Apache CouchDB on Ubuntu 16.04?

Apache CouchDB is open source database software that focuses on ease of use and having a scalable...