** Description changed:

  After uninstalling the package ubuntu-helper-virt-hwe there is a left
  over `/etc/apt/apt.conf.d/99-ubuntu-virt.conf` file.
  
  ```
  DPkg::Pre-Install-Pkgs {
-   "/usr/bin/apt_hook_ubuntu_virt || true";
+   "/usr/bin/apt_hook_ubuntu_virt || true";
  };
  // apt keys DPkg::Tools::options::<key>::Version is the first word
  // (up to the first space),so we can skip the "|| true" part
  DPkg::Tools::options::/usr/bin/apt_hook_ubuntu_virt::Version "2";
  ```
  
  It expect the script to be present, causing a not found error on apt
  operations:
  
- Fetched 87.6 kB in 1s (166 kB/s)       
+ Fetched 87.6 kB in 1s (166 kB/s)
  /bin/sh: 1: /usr/bin/apt_hook_ubuntu_virt: not found
+ 
+ EDIT:
+ 
+ After some further investigation, this appears to be a partial
+ regression of LP #2155665, introduced in `1:10.2.1+ds-1ubuntu4.4` as
+ part of the changes associated with LP #2164849.
+ 
+ The previous fix in `1ubuntu4.2` introduced an executable existence
+ check:
+ 
+ ```
+ "test -x /usr/bin/apt_hook_ubuntu_virt && /usr/bin/apt_hook_ubuntu_virt || 
true";
+ ```
+ 
+ However, as explained in comment #15 of LP #2164849, this prevented APT
+ from correctly selecting protocol version 2, since the configuration
+ lookup key was derived from the first word of the command (`test`).
+ 
+ The subsequent fix changed the invocation to:
+ 
+ ```
+ "/usr/bin/apt_hook_ubuntu_virt || true";
+ ```
+ 
+ While this restores protocol version 2 and prevents APT from aborting,
+ it reintroduces the missing executable error anticipated in comment #14
+ of LP #2164849.
+ 
+ Although both files belong to the same binary package,
+ `/etc/apt/apt.conf.d/99-ubuntu-virt.conf` is registered as a conffile,
+ whereas `/usr/bin/apt_hook_ubuntu_virt` is not. Consequently, a regular
+ package removal preserves the hook configuration while removing the
+ executable.
+ 
+ The expected behaviour would be to preserve protocol version 2 while
+ silently skipping the hook when the executable is no longer present.
+ 
+ I'm currently investigating APT's hook implementation to determine an
+ appropriate fix.

** Summary changed:

- 99-ubuntu-virt.conf left over after package uninstall
+ [Regression] ubuntu-helper-virt-hwe leaves an active APT hook referencing a 
removed executable

** Tags added: regression-update

** Description changed:

- After uninstalling the package ubuntu-helper-virt-hwe there is a left
- over `/etc/apt/apt.conf.d/99-ubuntu-virt.conf` file.
- 
- ```
- DPkg::Pre-Install-Pkgs {
-   "/usr/bin/apt_hook_ubuntu_virt || true";
- };
- // apt keys DPkg::Tools::options::<key>::Version is the first word
- // (up to the first space),so we can skip the "|| true" part
- DPkg::Tools::options::/usr/bin/apt_hook_ubuntu_virt::Version "2";
- ```
- 
- It expect the script to be present, causing a not found error on apt
- operations:
- 
- Fetched 87.6 kB in 1s (166 kB/s)
- /bin/sh: 1: /usr/bin/apt_hook_ubuntu_virt: not found
- 
- EDIT:
- 
  After some further investigation, this appears to be a partial
  regression of LP #2155665, introduced in `1:10.2.1+ds-1ubuntu4.4` as
  part of the changes associated with LP #2164849.
  
  The previous fix in `1ubuntu4.2` introduced an executable existence
  check:
  
  ```
  "test -x /usr/bin/apt_hook_ubuntu_virt && /usr/bin/apt_hook_ubuntu_virt || 
true";
  ```
  
  However, as explained in comment #15 of LP #2164849, this prevented APT
  from correctly selecting protocol version 2, since the configuration
  lookup key was derived from the first word of the command (`test`).
  
  The subsequent fix changed the invocation to:
  
  ```
  "/usr/bin/apt_hook_ubuntu_virt || true";
  ```
  
  While this restores protocol version 2 and prevents APT from aborting,
  it reintroduces the missing executable error anticipated in comment #14
  of LP #2164849.
  
  Although both files belong to the same binary package,
  `/etc/apt/apt.conf.d/99-ubuntu-virt.conf` is registered as a conffile,
  whereas `/usr/bin/apt_hook_ubuntu_virt` is not. Consequently, a regular
  package removal preserves the hook configuration while removing the
  executable.
  
  The expected behaviour would be to preserve protocol version 2 while
  silently skipping the hook when the executable is no longer present.
  
  I'm currently investigating APT's hook implementation to determine an
  appropriate fix.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2176161

Title:
  [Regression] ubuntu-helper-virt-hwe leaves an active APT hook
  referencing a removed executable

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/qemu-hwe/+bug/2176161/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to