osm2pgrouting command not found

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

Introduction

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

osm2pgrouting: command not found

or when using sudo you get the following error message

sudo: osm2pgrouting: command not found

Solutions to osm2pgrouting: command not found

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

In Ubuntu osm2pgrouting is provided by osm2pgrouting package.

osm2pgrouting is:

osm2pgrouting is a command line tool that makes it easy to import OpenStreetMap data into a pgRouting database. It builds the routing network topology automatically and creates tables for feature types and road classes. pgRouting has to be installed to be able to run osm2pgrouting.

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

sudo apt-get -y install osm2pgrouting

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

You can also use apt command to install osm2pgrouting.

sudo apt -y install osm2pgrouting

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

sudo aptitude install osm2pgrouting

Summary

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