cgdisk command not found

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

Introduction

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

cgdisk: command not found

or when using sudo you get the following error message

sudo: cgdisk: command not found

Solutions to cgdisk: command not found

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

In Ubuntu cgdisk is provided by gdisk package.

gdisk is:

GPT fdisk (aka gdisk) is a text-mode partitioning tool that provides utilities for Globally Unique Identifier (GUID) Partition Table (GPT) disks.

Features:

  • Edit GUID partition table definitions
  • In place conversion of BSD disklabels to GPT
  • In place conversion of MBR to GPT
  • In place conversion of GPT to MBR
  • Create hybrid MBR/GPT layouts
  • Repair damaged GPT data structures
  • Repair damaged MBR structures
  • Back up GPT data to a file (and restore from file)

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

sudo apt-get -y install gdisk

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

You can also use apt command to install gdisk.

sudo apt -y install gdisk

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

sudo aptitude install gdisk

Summary

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