sql-migrate command not found

In this troubleshooting guide we learn how to fix sql-migrate command not found error message

Introduction

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

sql-migrate: command not found

or when using sudo you get the following error message

sudo: sql-migrate: command not found

Solutions to sql-migrate: command not found

How To Fix sql-migrate: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu sql-migrate is provided by sql-migrate package.

sql-migrate is:

sql-migrate is SQL Schema migration tool for Go based on gorp and goose

Features • Usable as a CLI tool or as a library • Supports SQLite, PostgreSQL, MySQL, MSSQL and Oracle databases (through gorp) • Can embed migrations into your application • Migrations are defined with SQL for full flexibility • Atomic migrations • Up/down migrations to allow rollback • Supports multiple database types in one project • Works great with other libraries such as sqlx

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

sudo apt-get -y install sql-migrate

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

You can also use apt command to install sql-migrate.

sudo apt -y install sql-migrate

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

sudo aptitude install sql-migrate

Summary

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