clang-format-12 command not found
Introduction
When you run more command in linux terminal / console, you get the following error message
clang-format-12: command not found
or when using sudo you get the following error message
sudo: clang-format-12: command not found
Solutions to clang-format-12: command not found
How To Fix clang-format-12: command not found in Ubuntu / Debian / Kali Linux / Raspbian
In Ubuntu clang-format-12 is provided by clang-format-12 package.
clang-format-12 is:
Clang-format is both a library and a stand-alone tool with the goal of automatically reformatting C++ sources files according to configurable style guides. To do so, clang-format uses Clang’s Lexer to transform an input file into a token stream and then changes all the whitespace around those tokens. The goal is for clang-format to both serve both as a user tool (ideally with powerful IDE integrations) and part of other refactoring tools, e.g. to do a reformatting of all the lines changed during a renaming.
This package also provides vim and emacs plugins.
To fix this problem, we can install more using the command below.
sudo apt-get -y install clang-format-12
This command might take some time to finish depending on your machine internet connection.
You can also use apt command to install clang-format-12.
sudo apt -y install clang-format-12
Or if you have aptitude installed you can use the following command.
sudo aptitude install clang-format-12
Summary
In this tutorial we learn how to fix clang-format-12 command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.