How to install Mozjpeg in Linux Mint 19

by Daniel Pham
Published: Updated:

This article will guide you how to install Mozjpeg in Linux Mint 19.

If you do not know what Mozjpeg is, you will know one more useful software through this article.

What is the Mozjpeg project?

Mozjpeg is a project of Mozilla. According to the homepage:

MozJPEG reduces file sizes of JPEG images while retaining quality and compatibility with the vast majority of the world’s deployed decoders.

You can read more about Mozjpeg’s features at this github link.

Basically for me, I use it to compress the images that I will upload to my blog.

Step-by-step to install Mozjpeg in Linux Mint 19

This section will present you step by step how to install Mozjpeg successfully on Linux Mint 19.

Install dependent packages

This software will need some of the following dependencies to work:

  • autoconf
  • automake
  • libtool
  • nasm
  • make

Now type the following command to install those dependencies.

danie@linux:~$ sudo apt-get install autoconf automake libtool nasm make -y

Download the source code

You can select their installed versions at this link, because the version may vary over time.

At the time I wrote this article, Mozjpeg has version v3.3.1.

Now type the following command to download and extract the source code.

Recommended Reading: How to install Pycharm community in Linux Mint

danie@linux:~$ cd /tmp
danie@linux:~$ wget https://github.com/mozilla/mozjpeg/archive/v3.3.1.tar.gz
danie@linux:~$ tar -xzf v3.3.1.tar.gz

Compile and install the source code

First, move to the unzipped folder of the source code.

danie@linux:~$ cd mozjpeg-3.3.1/

Next, use the autoreconf command to create the configure file for the source code.

danie@linux:~$ autoreconf -fiv

And then, you create the build directory to contain the installation files. Move into the build directory.

danie@linux:~$ mkdir build && cd build

Run the configure file to create the Makefile, which will be used to install the final program on your computer.

danie@linux:~$ sh ../configure

And finally, run make install with sudo permissions so that it installs Mozjpeg into the /opt folder in your computer.

danie@linux:~$ sudo make install

Recommended Reading: Install Tomate pomodoro software on Linux

how to install mozjpeg in linux mint 19
How to install Mozjpeg in Linux Mint 19.

Use Mozjpeg

Now, type the following command to see the executable files of Mozjpeg installed on your computer.

danie@linux:~$ ls /opt/mozjpeg/bin/
cjpeg djpeg jpegtran rdjpgcom tjbench wrjpgcom

There is a problem, if you want to use, for example jpegtran, you will have to type the command like this.

danie@linux:~$ /opt/mozjpeg/bin/jpegtran --help

Instead of typing such a command, we will create a link for easier use, we name it mozjpeg to make it easier to remember.

danie@linux:~$ sudo ln -s /opt/mozjpeg/bin/jpegtran /usr/local/bin/mozjpeg

Now you just need to type the command like this.

danie@linux:~$ mozjpeg --help

Conclusion

So the article has guided you step by step to successfully install the Mozjpeg tool in Linux Mint 19. I believe these installation steps will also work well on both new Ubuntu and Debian versions.

(This is an article from my old blog that has been inactive for a long time, I don’t want to throw it away so I will keep it and hope it helps someone).

0 0 votes
Article Rating

You may also like

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments

DevOps Lite is a personal blog specializing in technology with main topics about DevOps, DevSecOps, SRE and System Administrator. Articles are shared for free and contributed to the community.

SUPPORT US

FOLLOW US

Subscribe my Newsletter for new blog posts. Stay updated from your inbox!

© 2021-2024 DevOpsLite.com – All rights reserved.

Please write sources “DevOpsLite.com” when using articles from this website.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More

0
Would love your thoughts, please comment.x
()
x

Adblock Detected

Please support us by disabling your AdBlocker extension from your browsers for our website.