swtpm_setup command not found

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

Introduction

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

swtpm_setup: command not found

or when using sudo you get the following error message

sudo: swtpm_setup: command not found

Solutions to swtpm_setup: command not found

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

In Ubuntu swtpm_setup is provided by swtpm-tools package.

swtpm-tools is:

The swtpm-tools package contains the following types of tools:

  • swtpm_bios: Tool for initializing the TPM
  • swtpm_ioctl: Tool for controlling the CUSE TPM
  • swtpm_setup: Tool for creating the initial state of the TPM; this tool basically simulates TPM manufacturing where certificates are written into the NVRAM of the TPM
  • swtpm_cert: Creation of certificates for the TPM (x509)

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

sudo apt-get -y install swtpm-tools

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

You can also use apt command to install swtpm-tools.

sudo apt -y install swtpm-tools

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

sudo aptitude install swtpm-tools

Summary

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