Expand description
apt-family package management actions (Ubuntu / Debian).
All apt commands run with DEBIAN_FRONTEND=noninteractive and
NEEDRESTART_MODE=a so they never block waiting for a TUI prompt.
§Lock contention
Before any mutating apt command the executor should detect dpkg lock
contention via fuser /var/lib/dpkg/lock. That check lives in the
executor; this module only builds the ActionSpec for the apt
command itself. The executor layer is responsible for the retry-after
hint when the lock is held.
§Environment variables
DEBIAN_FRONTEND=noninteractive suppresses all debconf prompts.
NEEDRESTART_MODE=a tells the needrestart post-install hook to
automatically restart services instead of prompting the operator.
Both are required for daemon-driven apt invocations; omitting them
causes apt to hang waiting for terminal input that never arrives.
Functions§
- apt_
autoremove - Remove automatically-installed packages no longer needed (
apt-get autoremove -y). - apt_
history_ list - Show recent apt transaction history from
/var/log/apt/history.log. - apt_
hold - Pin a package at its current version (
apt-mark hold <package>). - apt_
install - Install a single package (
apt-get install -y <package>). - apt_
list_ installed - List all installed packages (
dpkg -l). - apt_
list_ upgradable - List packages that have upgrades available (
apt list --upgradable). - apt_
purge - Remove a package AND its configuration files (
apt-get purge -y <package>). - apt_
remove - Remove a package but keep its configuration files (
apt-get remove -y <package>). - apt_
search - Search apt repositories for packages matching a term (
apt-cache search <term>). - apt_
show - Show detailed information about a package (
apt-cache show <package>). - apt_
unhold - Remove the hold on a package, allowing upgrades again (
apt-mark unhold <package>). - apt_
update - Refresh the apt package index (
apt-get update). - apt_
upgrade - Upgrade all installed packages (
apt-get dist-upgrade -y). - configure_
unattended_ upgrades - Enable or disable Ubuntu automatic (unattended) security updates.
- specs
- Return one representative
ActionSpecper action name so the consistency test can verify policy + preview + executor coverage.