LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

update-mime-database

Build shared MIME-Info database cache

TLDR

Update system MIME database
$ sudo update-mime-database /usr/share/mime
copy
Update user MIME database
$ update-mime-database ~/.local/share/mime
copy
Show version
$ update-mime-database -v
copy
Display help
$ update-mime-database -h
copy

SYNOPSIS

update-mime-database [options] mime-dir

DESCRIPTION

update-mime-database builds the shared MIME-Info database cache from XML source files. It scans the specified directory for MIME type definitions and compiles them into an optimized binary cache (mime.cache) for fast application access.The database maps file patterns, magic bytes, and other characteristics to MIME types, enabling applications to correctly identify file types. System-wide definitions go in /usr/share/mime while user customizations use ~/.local/share/mime.Package managers typically run this command automatically when installing software that provides new MIME type definitions. Manual execution is needed when adding custom MIME types.

PARAMETERS

-h

Display help and exit.
-v
Display version and exit.
-V
Verbose output during processing.
-n
Only update if files have changed.

DIRECTORIES

/usr/share/mime: System-wide MIME database./usr/share/mime/packages/: Source XML files for MIME types.~/.local/share/mime: User-specific MIME database.

INSTALL

sudo apt install shared-mime-info
copy
sudo dnf install shared-mime-info
copy
sudo pacman -S shared-mime-info
copy
sudo apk add shared-mime-info
copy
sudo zypper install shared-mime-info
copy
brew install shared-mime-info
copy
nix profile install nixpkgs#shared-mime-info
copy

CAVEATS

Requires write permission to target directory. System directory updates need root privileges. Applications may need restart to recognize new types. Part of the shared-mime-info package.

HISTORY

update-mime-database is part of the freedesktop.org shared-mime-info project, created to standardize MIME type handling across Linux desktop environments. Before this project, GNOME and KDE maintained separate incompatible MIME databases.

SEE ALSO

xdg-mime(1), file(1), mimetype(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid