serverspec-init command not found

In this troubleshooting guide we learn how to fix serverspec-init command not found error message

Introduction

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

serverspec-init: command not found

or when using sudo you get the following error message

sudo: serverspec-init: command not found

Solutions to serverspec-init: command not found

How To Fix serverspec-init: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu serverspec-init is provided by ruby-serverspec package.

ruby-serverspec is:

With serverspec, you can write RSpec tests for checking your servers are configured correctly.

Serverspec tests your servers’ actual state through SSH access, so you don’t need to install any agent software on your servers and can use any configuration management tools, Puppet, Chef, CFEngine and so on.

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

sudo apt-get -y install ruby-serverspec

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

You can also use apt command to install ruby-serverspec.

sudo apt -y install ruby-serverspec

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

sudo aptitude install ruby-serverspec

Summary

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