tpm2_ptool command not found

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

Introduction

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

tpm2_ptool: command not found

or when using sudo you get the following error message

sudo: tpm2_ptool: command not found

Solutions to tpm2_ptool: command not found

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

In Ubuntu tpm2_ptool is provided by libtpm2-pkcs11-tools package.

libtpm2-pkcs11-tools is:

tpm2-pkcs11 is a utility to provide a PKCS#11 backend for a TPM 2.0 (Trusted Platform Module) chip in order to access cryptographic services from tokens/ devices such as hardware security modules (HSM), smart cards, etc.

This package provides the tpm2_ptool command-line utility.

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

sudo apt-get -y install libtpm2-pkcs11-tools

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

You can also use apt command to install libtpm2-pkcs11-tools.

sudo apt -y install libtpm2-pkcs11-tools

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

sudo aptitude install libtpm2-pkcs11-tools

Summary

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