dpkg-trigger
Trigger package actions after upgrade or installation
SYNOPSIS
dpkg-trigger [option...] [trigger-name]
PARAMETERS
--admindir=dir
Set dpkg admin directory (default: /var/lib/dpkg)
--check[=package-name]
Check for pending triggers; print 'yes' if any, exit 0 if waiting
--help, -?, -h
Display usage summary and exit
--list[=trigger-name]
List packages interested in trigger (all if unspecified)
--no-act
Simulate actions without processing triggers
--print-avail
List all triggers awaiting processing
--root=dir
Override root directory
--update-flags=flag[,flag…]
Filter triggers for --check/--print-avail (e.g., interest-await)
--version
Show version information and exit
DESCRIPTION
The dpkg-trigger command is a utility in Debian-based Linux distributions for managing and invoking triggers within the dpkg package management system.
Triggers allow packages to declare interest in specific events, such as the installation of files in shared directories (e.g., icons or desktop files), without requiring immediate script execution during package installation. This defers costly operations until necessary, improving efficiency. When a trigger condition is met (like adding a file to /usr/share/icons), dpkg records it, and dpkg-trigger is called later to notify interested packages via their trigger scripts.
Primarily used automatically by dpkg during operations like dpkg -i or apt install, it can also be invoked manually by administrators or maintainer scripts. For example, after manually placing files in a trigger directory, run dpkg-trigger to process pending triggers. It supports checking pending triggers, listing interested packages, and firing specific triggers by name.
CAVEATS
Manual use risks package inconsistencies; prefer automation via dpkg/apt. Requires root privileges for most operations. Not for direct user scripts.
EXAMPLES
dpkg-trigger update-desktop-database
Fires desktop file triggers.
dpkg-trigger --check
Checks if any package has pending triggers.
dpkg-trigger --list=menu
Lists packages interested in 'menu' trigger.
HISTORY
Introduced in dpkg 1.14.13 (2009) with trigger support; evolved in dpkg 1.17+ for better multiarch and efficiency. Widely used in Ubuntu/Debian since.


