gsort command not found

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

Introduction

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

gsort: command not found

or when using sudo you get the following error message

sudo: gsort: command not found

Solutions to gsort: command not found

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

In Ubuntu gsort is provided by gsort package.

gsort is:

gsort is a tool to sort genomic files according to a genomefile. For example, to sort VCF to have order: X, Y, 2, 1, 3, … and the header needs to be kept at the top.

As a more likely example, if a file nneds to be sorted to match GATK order (1 … X, Y, MT) which is not possible with any other sorting tool. With gsort one can simply place MT as the last chrom in the “.genome” file.

It will also be useful for getting files ready for use in bedtools.

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

sudo apt-get -y install gsort

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

You can also use apt command to install gsort.

sudo apt -y install gsort

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

sudo aptitude install gsort

Summary

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