git-linguist command not found

In this troubleshooting guide we learn how to fix git-linguist command not found error message

Introduction

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

git-linguist: command not found

or when using sudo you get the following error message

sudo: git-linguist: command not found

Solutions to git-linguist: command not found

How To Fix git-linguist: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu git-linguist is provided by ruby-github-linguist package.

ruby-github-linguist is:

Language detection: ruby-github-linguist defines a list of all languages known to GitHub in a yaml file. In order for a file to be highlighted, a language and a lexer must be defined there.

Syntax Highlighting: The actual syntax highlighting is handled by the Pygments wrapper, ruby-pygments.rb. It also provides a Lexer abstraction that determines which highlighter should be used on a file.

Stats: The Language stats bar that you see on every repository is built by aggregating the languages of each file in that repository. The top language in the graph determines the project’s primary language.

Ignore vendored files: Checking other code into your git repo is a common practice. But this often inflates your project’s language stats and may even cause your project to be labeled as another language. ruby-github-linguist is able to identify some of these files and directories and exclude them.

Generated file detection: Not all plain text files are true source files. Generated files like minified js and compiled CoffeeScript can be detected and excluded from language stats. As an extra bonus, these files are suppressed in diffs.

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

sudo apt-get -y install ruby-github-linguist

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

You can also use apt command to install ruby-github-linguist.

sudo apt -y install ruby-github-linguist

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

sudo aptitude install ruby-github-linguist

Summary

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