mimetype command not found

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

Introduction

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

mimetype: command not found

or when using sudo you get the following error message

sudo: mimetype: command not found

Solutions to mimetype: command not found

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

In Ubuntu mimetype is provided by libfile-mimeinfo-perl package.

libfile-mimeinfo-perl is:

File::MimeInfo can be used to determine the mime type of a file. It tries to implement the freedesktop specification for a shared MIME database.

This package also contains two related utilities:

  • mimetype: determine a file’s mimetype
  • mimeopen: open files according to their mimetype

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

sudo apt-get -y install libfile-mimeinfo-perl

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

You can also use apt command to install libfile-mimeinfo-perl.

sudo apt -y install libfile-mimeinfo-perl

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

sudo aptitude install libfile-mimeinfo-perl

Summary

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