cobra command not found

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

Introduction

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

cobra: command not found

or when using sudo you get the following error message

sudo: cobra: command not found

Solutions to cobra: command not found

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

In Ubuntu cobra is provided by cobra package.

cobra is:

Cobra is a Go library providing a simple interface to create powerful modern CLI interfaces similar to git & go tools.

Cobra has an exceptionally clean interface and simple design without needless constructors or initialization methods.

This package contains the Cobra Generator as /usr/bin/cobra, a tool that will generate your application scaffolding to rapidly develop a Cobra-based application.

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

sudo apt-get -y install cobra

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

You can also use apt command to install cobra.

sudo apt -y install cobra

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

sudo aptitude install cobra

Summary

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