Public bug reported:
The package ubuntu-helper-virt-hwe ships /etc/apt/apt.conf.d/99-ubuntu-
virt.conf, which registers a DPkg::Pre-Install-Pkgs hook that runs
/usr/bin/apt_hook_ubuntu_virt. On my system that script does not exist,
so any apt operation that installs at least one package aborts.
Error observed:
/bin/sh: 1: /usr/bin/apt_hook_ubuntu_virt: not found
Error: Sub-process /usr/bin/apt_hook_ubuntu_virt returned an error code (127)
Error: Failure running script /usr/bin/apt_hook_ubuntu_virt
Steps to reproduce:
1. Have ubuntu-helper-virt-hwe installed (it ships 99-ubuntu-virt.conf).
2. Run any install, e.g. sudo apt install rpi-imager.
3. After confirming, the hook fires and the operation aborts with the error
above. Nothing is installed.
Investigation:
- ls -l /usr/bin/apt_hook_ubuntu_virt -> No such file or directory.
- grep -rn apt_hook_ubuntu_virt /etc/apt/apt.conf.d/ -> declared in
99-ubuntu-virt.conf, including a line
DPkg::Tools::options::/usr/bin/apt_hook_ubuntu_virt::Version "2";
which confirms it is a Pre-Install-Pkgs hook.
- dpkg -S /etc/apt/apt.conf.d/99-ubuntu-virt.conf -> ubuntu-helper-virt-hwe.
- dpkg -S /usr/bin/apt_hook_ubuntu_virt -> no path found matching pattern.
- dpkg --configure -a reports nothing to configure (package is fully
configured).
The conf file is a tracked file of the package, but the hook script it points to
is not in the package's file list. That suggests the script is meant to be
created by the package's maintainer scripts (or by ubuntu_virt_helper), and that
step either never ran or did not complete -- yet the conf that depends on it is
active. The net effect is a hook that blocks all installs.
Impact:
Any apt transaction that unpacks/installs at least one package fails.
Operations
with zero installs (apt -f install with nothing to do, or a pure package
removal)
are NOT affected, which makes the failure look intermittent and easy to
misattribute to whatever package was being installed.
Workarounds:
- Stub the path with a no-op and reinstall the package:
printf '#!/bin/sh\nexit 0\n' | sudo tee /usr/bin/apt_hook_ubuntu_virt
>/dev/null
sudo chmod +x /usr/bin/apt_hook_ubuntu_virt
sudo apt install --reinstall ubuntu-helper-virt-hwe
- Or remove the package entirely (a pure removal does not trip the hook):
sudo apt purge ubuntu-helper-virt-hwe
Additional data point:
A user on the French Ubuntu forum reported the identical failure on 26.04
while
installing VirtualBox, suggesting it is not specific to my system:
https://forum.ubuntu-fr.org/viewtopic.php?id=2095373
Environment:
- Ubuntu <fill in: output of lsb_release -d>
- ubuntu-helper-virt-hwe <fill in: output of apt-cache policy
ubuntu-helper-virt-hwe>
- Source package: qemu-hwe
ProblemType: Bug
DistroRelease: Ubuntu 26.04
Package: ubuntu-helper-virt-hwe 1:10.2.1+ds-1ubuntu4
ProcVersionSignature: Ubuntu 7.0.0-22.22-generic 7.0.0
Uname: Linux 7.0.0-22-generic x86_64
ApportVersion: 2.34.0-0ubuntu2
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: ubuntu:GNOME
Date: Sat Jun 13 19:51:32 2026
InstallationDate: Installed on 2025-01-31 (498 days ago)
InstallationMedia: Ubuntu 24.04.1 LTS "Noble Numbat" - Release amd64
(20240827.1)
PackageArchitecture: all
ProcEnviron:
LANG=en_US.UTF-8
PATH=(custom, no user)
SHELL=/bin/bash
TERM=xterm-256color
XDG_RUNTIME_DIR=<set>
SourcePackage: qemu-hwe
UpgradeStatus: Upgraded to resolute on 2026-05-08 (36 days ago)
modified.conffile..etc.apt.apt.conf.d.99-ubuntu-virt.conf: [deleted]
** Affects: qemu-hwe (Ubuntu)
Importance: Undecided
Status: New
** Tags: amd64 apport-bug resolute wayland-session
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2156663
Title:
ubuntu-helper-virt-hwe: 99-ubuntu-virt.conf references missing
/usr/bin/apt_hook_ubuntu_virt, breaking all apt installs (exit 127)
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/qemu-hwe/+bug/2156663/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs