dirhash command not found

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

Introduction

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

dirhash: command not found

or when using sudo you get the following error message

sudo: dirhash: command not found

Solutions to dirhash: command not found

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

In Ubuntu dirhash is provided by python3-dirhash package.

python3-dirhash is:

A lightweight Python module and CLI for computing the hash of any directory based on its files’ structure and content.

  • Supports all hashing algorithms of Python’s built-in hashlib module.
  • Glob/wildcard (".gitignore style") path matching for expressive filtering of files to include/exclude.
  • Multiprocessing for up to 6x speed-up

The hash is computed according to the Dirhash Standard, which is designed to allow for consistent and collision resistant generation/verification of directory hashes across implementations.

This package installs the library for Python 3, and the cli tool.

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

sudo apt-get -y install python3-dirhash

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

You can also use apt command to install python3-dirhash.

sudo apt -y install python3-dirhash

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

sudo aptitude install python3-dirhash

Summary

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