swig command not found

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

Introduction

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

swig: command not found

or when using sudo you get the following error message

sudo: swig: command not found

Solutions to swig: command not found

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

In Ubuntu swig is provided by swig package.

swig is:

SWIG is a compiler that makes it easy to integrate C and C++ code with other languages including Perl, Tcl, Ruby, Python, Java, Guile, Mzscheme, Chicken, OCaml, Pike, and C#.

Swig takes a set of ANSI C/C++ declarations and generates an interface for them to your favorite scripting language.

This is a dependency package providing the stable version of SWIG.

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

sudo apt-get -y install swig

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

You can also use apt command to install swig.

sudo apt -y install swig

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

sudo aptitude install swig

Summary

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