update-desktop-database
Update desktop entry database
SYNOPSIS
update-desktop-database [OPTIONS] [DIRECTORY...]
PARAMETERS
--help
Displays a help message and exits.
--quiet
Suppresses all output messages during execution.
--verbose
Provides more detailed output, showing which files are processed.
--system
Updates the system-wide database, typically located at /usr/share/applications/mimeinfo.cache. This operation usually requires root privileges.
--user
Updates the user-specific database, typically located at ~/.local/share/applications/mimeinfo.cache. This is the default behavior if no DIRECTORY is specified.
DIRECTORY...
One or more paths to directories containing .desktop files that should be scanned. If no directories are provided, the command defaults to scanning standard system or user application directories based on the --system or --user flag.
DESCRIPTION
The update-desktop-database command is a crucial utility for Linux desktop environments, responsible for maintaining a cache of MIME types handled by installed applications. It scans .desktop files located in specified directories (or standard system/user paths) and extracts the MimeType entries from them. This extracted information is then compiled into a mimeinfo.cache file. This cache allows desktop environments like GNOME, KDE, and XFCE to quickly identify which applications are capable of opening files of a particular type, improving performance and responsiveness when launching applications or associating file types. It's commonly run automatically by package managers after software installation or removal to ensure the application database is up-to-date.
CAVEATS
This command should be run whenever new applications are installed, existing ones are removed, or their .desktop files are modified, especially regarding MimeType associations.
It is often executed automatically by package managers during installation or upgrade processes.
Running --system usually requires superuser privileges.
CACHE LOCATION
The generated mimeinfo.cache file is typically found in /usr/share/applications/ for system-wide updates or ~/.local/share/applications/ for user-specific updates. This cache file significantly speeds up MIME type lookups compared to parsing individual .desktop files every time.
DEPENDENCY ON .DESKTOP FILES
The effectiveness of update-desktop-database relies entirely on the correct and compliant .desktop files. Applications define their capabilities and supported MIME types within these files. If a .desktop file is malformed or missing MimeType entries, the application's associations might not be correctly cached.
HISTORY
The update-desktop-database command is part of the desktop-file-utils package, which originated from the FreeDesktop.org initiative. Its development was driven by the need for a standardized way for desktop environments on Linux and other Unix-like systems to manage and discover applications and their associated MIME types. It plays a key role in implementing the XDG Base Directory Specification and related standards, ensuring interoperability and consistency across different desktop environments.
SEE ALSO
xdg-mime(1), xdg-open(1), update-mime-database(8), desktop-file-install(1)