m2r command not found

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

Introduction

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

m2r: command not found

or when using sudo you get the following error message

sudo: m2r: command not found

Solutions to m2r: command not found

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

In Ubuntu m2r is provided by m2r package.

m2r is:

M2R converts a markdown file including reStructuredText (rst) markups to a valid rst format.

Use case is writing sphinx document in markdown, since it’s widely used now and easy to write code blocks and lists. However, converters using pandoc or recommonmark do not support many rst markups and sphinx extensions. For example, rst’s reference link like see `ref`_ (this is very convenient in long document in which same link appears multiple times) will be converted to a code block in HTML like see <code>ref</code>_, which is not expected.

This package provides the command-line tool m2r.

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

sudo apt-get -y install m2r

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

You can also use apt command to install m2r.

sudo apt -y install m2r

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

sudo aptitude install m2r

Summary

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