virt-sparsify command not found

In this troubleshooting guide we learn how to fix virt-sparsify command not found error message

Introduction

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

virt-sparsify: command not found

or when using sudo you get the following error message

sudo: virt-sparsify: command not found

Solutions to virt-sparsify: command not found

How To Fix virt-sparsify: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu virt-sparsify is provided by guestfs-tools package.

guestfs-tools is:

The libguestfs library allows accessing and modifying guest disk images.

This package contains the guestfish interactive shell and various virtualization tools, including virt-cat, virt-df, virt-edit, virt-filesystems, virt-inspector, virt-ls, virt-make-fs, virt-rescue, virt-resize, virt-tar, and virt-win-reg.

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

sudo apt-get -y install guestfs-tools

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

You can also use apt command to install guestfs-tools.

sudo apt -y install guestfs-tools

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

sudo aptitude install guestfs-tools

Summary

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