{"id":7128,"date":"2018-10-22T16:35:23","date_gmt":"2018-10-22T13:35:23","guid":{"rendered":"https:\/\/www.howtoforge.com\/tutorial\/how-to-compile-brotli-from-source-on-ubuntu-1804\/"},"modified":"2018-10-22T16:35:23","modified_gmt":"2018-10-22T13:35:23","slug":"how-to-compile-brotli-from-source-on-ubuntu-18-04-lts","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/how-to-compile-brotli-from-source-on-ubuntu-18-04-lts\/","title":{"rendered":"How to Compile Brotli from Source on Ubuntu 18.04 LTS"},"content":{"rendered":"<p>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<span>\u00a0<\/span><a href=\"https:\/\/tools.ietf.org\/html\/rfc7932\" rel=\"nofollow noopener\" target=\"_blank\">RFC 7932<\/a>.<\/p>\n<p>This tutorial shows how to compile Brotli compression library from source on Ubuntu 18.04 LTS (Bionic Beaver).<\/p>\n<h2 id=\"requirements\">Requirements<\/h2>\n<ul>\n<li>Ubuntu 18.04 LTS system.<\/li>\n<li>Non root user with sudo access.<\/li>\n<\/ul>\n<h2 id=\"initial-steps\">Initial steps<\/h2>\n<p>Check the Ubuntu version.<\/p>\n<p class=\"command\">lsb_release -ds<br \/># Ubuntu 18.04.1 LTS<\/p>\n<p>Set up the timezone.<\/p>\n<p class=\"command\">sudo dpkg-reconfigure tzdata<\/p>\n<p>Update\u00a0your opereting system packages.<\/p>\n<p class=\"command\">sudo apt update &amp;&amp; sudo apt upgrade -y<\/p>\n<h2 id=\"build-brotli\">Build Brotli<\/h2>\n<p>Install build tools and required packages.<\/p>\n<p class=\"command\">sudo apt install -y build-essential gcc make bc sed autoconf automake libtool git apt-transport-https tree<\/p>\n<p>Clone Brotli repository.<\/p>\n<p class=\"command\">git clone https:\/\/github.com\/google\/brotli.git<\/p>\n<p>Navigate to Brotli source tree directory.<\/p>\n<p class=\"command\">cd brotli<\/p>\n<p>Create manual page for Brotli command.<\/p>\n<p class=\"command\">sudo cp ~\/brotli\/docs\/brotli.1 \/usr\/share\/man\/man1 &amp;&amp; sudo gzip \/usr\/share\/man\/man1\/brotli.1<\/p>\n<p>Check the man page.<\/p>\n<p class=\"command\">man brotli<\/p>\n<p>To generate Autotools<span>\u00a0<\/span><code>configure<\/code><span>\u00a0<\/span>file run<span>\u00a0<\/span><code>.\/bootstrap<\/code><span>\u00a0<\/span>command first.<\/p>\n<p class=\"command\">.\/bootstrap<\/p>\n<p>After the above command, you should have access to usual C program build steps:<span>\u00a0<\/span><code>configure<\/code>,<span>\u00a0<\/span><code>make<\/code><span>\u00a0<\/span>and<span>\u00a0<\/span><code>make install <\/code>available.<\/p>\n<p>For help, you can run<span>\u00a0<\/span><code>.\/configure --help<\/code><span>\u00a0<\/span>command. Now we are ready to build Brotli with the following instructions.<\/p>\n<p><span>The basic commands to build and install brotli are:<\/span><\/p>\n<p class=\"command\">.\/configure &#8211;prefix=\/usr \\<br \/>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 &#8211;bindir=\/usr\/bin \\<br \/>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 &#8211;sbindir=\/usr\/sbin \\<br \/>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 &#8211;libexecdir=\/usr\/lib\/brotli \\<br \/>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 &#8211;libdir=\/usr\/lib\/brotli \\<br \/>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 &#8211;datarootdir=\/usr\/share \\<br \/>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 &#8211;mandir=\/usr\/share\/man\/man1 \\<br \/>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 &#8211;docdir=\/usr\/share\/doc<\/p>\n<p>make<br \/>sudo make install<\/p>\n<p>After the successful build process, you can check Brotli version.<\/p>\n<p class=\"command\">brotli &#8211;version<br \/># brotli 1.0.6<\/p>\n<p>To see help about brotli command, you can run:<\/p>\n<p class=\"command\"><span>brotli -h<\/span><\/p>\n<h2 id=\"links\">Links<\/h2>\n<div class=\"authorbox\" readability=\"18\">\n<img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/10\/how-to-compile-brotli-from-source-on-ubuntu-18-04-lts.png\" alt=\"Blago Eres\" title=\"\"> <\/p>\n<p><strong>About Blago Eres<\/strong><\/p>\n<p>Blago Eres is a freelance Web Developer, Linux System Administrator and Technical Writer with more than 3 years of experience. Blago is skilled at RHEL\/CentOS, Debian\/Ubuntu, Web Servers, Database Servers, HTTP, PHP, JavaScript, Load Balancing, Caching etc.<\/p>\n<\/div>\n<div>\n<p><b>Share this page:<\/b><\/p>\n<p>\n<a href=\"https:\/\/www.facebook.com\/sharer.php?u=https%3A%2F%2Fwww.howtoforge.com%2Ftutorial%2Fhow-to-compile-brotli-from-source-on-ubuntu-1804%2F\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/10\/how-to-compile-brotli-from-source-on-ubuntu-18-04-lts-1.png\" height=\"20\" alt=\"\" title=\"\"><\/a><br \/>\n<a href=\"https:\/\/twitter.com\/intent\/tweet?url=https%3A%2F%2Fwww.howtoforge.com%2Ftutorial%2Fhow-to-compile-brotli-from-source-on-ubuntu-1804%2F&amp;text=How+to+Compile+Brotli+from+Source+on+Ubuntu+18.04+LTS&amp;via=howtoforgecom&amp;related=howtoforgecom\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/10\/how-to-compile-brotli-from-source-on-ubuntu-18-04-lts-2.png\" height=\"20\" alt=\"\" title=\"\"><\/a><br \/>\n<a href=\"https:\/\/twitter.com\/howtoforgecom\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/10\/how-to-compile-brotli-from-source-on-ubuntu-18-04-lts-3.png\" height=\"20\" alt=\"\" title=\"\"><\/a><br \/>\n<a href=\"https:\/\/plus.google.com\/share?url=https%3A%2F%2Fwww.howtoforge.com%2Ftutorial%2Fhow-to-compile-brotli-from-source-on-ubuntu-1804%2F\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/10\/how-to-compile-brotli-from-source-on-ubuntu-18-04-lts-4.png\" height=\"20\" alt=\"\" title=\"\"><\/a>\n<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36],"tags":[],"class_list":["post-7128","post","type-post","status-publish","format-standard","hentry","category-36"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/7128","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/comments?post=7128"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/7128\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=7128"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=7128"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=7128"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}