sparse-llvm command not found

In this troubleshooting guide we learn how to fix sparse-llvm command not found error message

Introduction

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

sparse-llvm: command not found

or when using sudo you get the following error message

sudo: sparse-llvm: command not found

Solutions to sparse-llvm: command not found

How To Fix sparse-llvm: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu sparse-llvm is provided by sparse package.

sparse is:

Sparse, the semantic parser, provides a compiler frontend capable of parsing most of ANSI C as well as many GCC extensions, and a collection of sample compiler backends, including a static analyzer also called “sparse”. Sparse provides a set of annotations designed to convey semantic information about types, such as what address space pointers point to, or what locks a function acquires or releases.

Sparse can be invoked directly as “sparse” or via the “cgcc” wrapper around the C compiler.

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

sudo apt-get -y install sparse

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

You can also use apt command to install sparse.

sudo apt -y install sparse

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

sudo aptitude install sparse

Summary

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