shc command not found

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

Introduction

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

shc: command not found

or when using sudo you get the following error message

sudo: shc: command not found

Solutions to shc: command not found

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

In Ubuntu shc is provided by shc package.

shc is:

SHC is a generic shell script compiler. It takes a script, which is specified on the command line and produces C source code. The generated source code is then compiled and linked to produce a stripped binary.

The compiled binary will still be dependent on the shell specified in the first line of the shell code, thus shc does not create completely independent binaries.

shc itself is not a compiler such as cc, it rather encodes and encrypts a shell script and generates C source code with the added expiration capability. It then uses the system compiler to compile a stripped binary which behaves exactly like the original script. Upon execution, the compiled binary will decrypt and execute the code with the shells’ -c option.

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

sudo apt-get -y install shc

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

You can also use apt command to install shc.

sudo apt -y install shc

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

sudo aptitude install shc

Summary

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