update-mime-database command not found

In this troubleshooting guide we learn how to fix update-mime-database command not found error message

Introduction

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

update-mime-database: command not found

or when using sudo you get the following error message

sudo: update-mime-database: command not found

Solutions to update-mime-database: command not found

How To Fix update-mime-database: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu update-mime-database is provided by shared-mime-info package.

shared-mime-info is:

This is the shared MIME-info database from the X Desktop Group. It is required by any program complying to the Shared MIME-Info Database spec, which is also included in this package.

At this time at least ROX, GNOME, KDE and Xfce use this database.

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

sudo apt-get -y install shared-mime-info

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

You can also use apt command to install shared-mime-info.

sudo apt -y install shared-mime-info

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

sudo aptitude install shared-mime-info

Summary

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