latex2dvi command not found
Introduction
When you run more command in linux terminal / console, you get the following error message
latex2dvi: command not found
or when using sudo you get the following error message
sudo: latex2dvi: command not found
Solutions to latex2dvi: command not found
How To Fix latex2dvi: command not found in Ubuntu / Debian / Kali Linux / Raspbian
In Ubuntu latex2dvi is provided by liblatex-driver-perl package.
liblatex-driver-perl is:
The LaTeX::Driver module encapsulates the details of invoking the LaTeX programs to format a LaTeX document. Formatting with LaTeX is complicated; there are potentially many programs to run and the output of those programs must be monitored to determine whether further processing is required.
LaTeX::Driver runs the required commands in the directory specified, either explicitly with the dirname option or implicitly by the directory part of basename, or in the current directory. As a result of the processing up to a dozen or more intermediate files are created. These can be removed with the cleanup method.
The LaTeX::Driver module takes care of running and re-running latex on a LaTeX document so that forward references, tables of contents, and lists of figures and tables are resolved. It will also run bibtex and makeindex if it detects that a bibliography or in index have been specified, and will re-run latex again one or more times until the formatting of the document has stabilized.
To fix this problem, we can install more using the command below.
sudo apt-get -y install liblatex-driver-perl
This command might take some time to finish depending on your machine internet connection.
You can also use apt command to install liblatex-driver-perl.
sudo apt -y install liblatex-driver-perl
Or if you have aptitude installed you can use the following command.
sudo aptitude install liblatex-driver-perl
Summary
In this tutorial we learn how to fix latex2dvi command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.