latexmk command not found

In this troubleshooting guide we learn how to fix latexmk command not found error message

Introduction

When you run more command in linux terminal / console, you get the following error message

latexmk: command not found

or when using sudo you get the following error message

sudo: latexmk: command not found

Solutions to latexmk: command not found

How To Fix latexmk: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu latexmk is provided by latexmk package.

latexmk is:

Latexmk runs LaTeX the correct number of times to resolve cross references, etc; it also runs auxiliary programs (bibtex, makeindex if necessary, and dvips and/or a previewer as requested). It has a number of other useful capabilities, for example to start a previewer and then run LaTeX whenever the source files are updated, so that the previewer gives an up-to-date view of the document.

To fix this problem, we can install more using the command below.

sudo apt-get -y install latexmk

This command might take some time to finish depending on your machine internet connection.

You can also use apt command to install latexmk.

sudo apt -y install latexmk

Or if you have aptitude installed you can use the following command.

sudo aptitude install latexmk

Summary

In this tutorial we learn how to fix latexmk command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.