How To Install shared-mime-info on CentOS 8

shared-mime-info is Shared MIME information database

Introduction

In this tutorial we learn how to install shared-mime-info on CentOS 8.

What is shared-mime-info

This is the freedesktop.org shared MIME info database. Many programs and desktops use the MIME system to represent the types of files. Frequently, it is necessary to work out the correct MIME type for a file. This is generally done by examining the file’s name or contents, and looking up the correct MIME type in a database.

We can use yum or dnf to install shared-mime-info on CentOS 8. In this tutorial we discuss both methods but you only need to choose one of method to install shared-mime-info.

Install shared-mime-info on CentOS 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install shared-mime-info using dnf by running the following command:

sudo dnf -y install shared-mime-info

Install shared-mime-info on CentOS 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install shared-mime-info using yum by running the following command:

sudo yum -y install shared-mime-info

How To Uninstall shared-mime-info on CentOS 8

To uninstall only the shared-mime-info package we can use the following command:

sudo dnf remove shared-mime-info

shared-mime-info Package Contents on CentOS 8

/usr/bin/update-mime-database
/usr/lib/.build-id
/usr/lib/.build-id/11
/usr/lib/.build-id/11/5f6716ea748ed50b53069dc843062ecdaa2d77
/usr/share/applications/gnome-mimeapps.list
/usr/share/applications/mimeapps.list
/usr/share/doc/shared-mime-info
/usr/share/doc/shared-mime-info/HACKING
/usr/share/doc/shared-mime-info/NEWS
/usr/share/doc/shared-mime-info/README
/usr/share/doc/shared-mime-info/shared-mime-info-spec.xml
/usr/share/licenses/shared-mime-info
/usr/share/licenses/shared-mime-info/COPYING
/usr/share/man/man1/update-mime-database.1.gz
/usr/share/mime
/usr/share/mime/packages
/usr/share/mime/packages/freedesktop.org.xml
/usr/share/pkgconfig
/usr/share/pkgconfig/shared-mime-info.pc

References

Summary

In this tutorial we learn how to install shared-mime-info on CentOS 8 using yum and dnf.