fiximports command not found

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

Introduction

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

fiximports: command not found

or when using sudo you get the following error message

sudo: fiximports: command not found

Solutions to fiximports: command not found

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

In Ubuntu fiximports is provided by golang-golang-x-tools package.

golang-golang-x-tools is:

This subrepository holds the source for various packages and tools that support the Go programming language.

Some of the tools, godoc and vet for example, used to be included in the golang-go package. Others, including the Go oracle and the test coverage tool, can be fetched with “go get”.

Packages include a type-checker for Go and an implementation of the Static Single Assignment form (SSA) representation for Go programs.

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

sudo apt-get -y install golang-golang-x-tools

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

You can also use apt command to install golang-golang-x-tools.

sudo apt -y install golang-golang-x-tools

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

sudo aptitude install golang-golang-x-tools

Summary

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