blhc command not found

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

Introduction

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

blhc: command not found

or when using sudo you get the following error message

sudo: blhc: command not found

Solutions to blhc: command not found

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

In Ubuntu blhc is provided by blhc package.

blhc is:

Perl tool which checks build logs for missing hardening flags. Hardening flags enable additional security features in the compiler to prevent e.g. stack overflows, format string vulnerabilities, GOT overwrites, etc. See e.g. http://wiki.debian.org/ReleaseGoals/SecurityHardeningBuildFlags.

Because most build systems are quite complicated there are many places where compiler flags from the environment might be ignored. The parser verifies that all compiler commands use the correct hardening flags and thus all hardening features are correctly used.

It’s designed to check build logs generated by Debian’s dpkg-buildpackage (or tools for packaging, using dpkg-buildpackage like pbuilder or the official buildd build logs) to help maintainers detect missing hardening flags in their packages.

Only gcc is detected as compiler at the moment (but other compilers maybe supported).

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

sudo apt-get -y install blhc

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

You can also use apt command to install blhc.

sudo apt -y install blhc

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

sudo aptitude install blhc

Summary

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