Bug 8912

Summary: [internalsolv] opkg remove --autoremove' does not fully uninstall product.
Product: [Yocto Project Subprojects] opkg Reporter: Max McCord <max.mccord>
Component: opkgAssignee: Alex Stewart <alex.stewart>
Status: ACCEPTED --- QA Contact:
Severity: minor    
Priority: Undecided CC: alejandro.delcastillo
Version: 0.3.0   
Target Milestone: ---   
Hardware: x86   
OS: x86_64   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description Max McCord 2016-01-12 21:49:39 UTC
The following issue occurs on a 64-bit Real-Time flavor of Linux.
https://github.com/ni/nilrt/tree/master

The core of the issue is that when we run these commands:

   opkg install my-product
   opkg remove --autoremove my-product

Many packages that were installed are left on the system, even though they are now orphaned (confirmed this using `opkg whatdepends`). In my case, around 40 packages were left on the system incorrectly.

Here is one particular example of a dependency hierarchy that caused an issue:

   Package: my-product
   Dependencies:
      my-product-data
      my-product-libs
      ...

   Package: my-product-libs
      my-product-data
      ...

When I run the command `opkg remove --autoremove my-product`, I would expect that my-product, my-product-libs, and my-product-data are all removed. However, in my case, my-product-data is left behind.

I have examined the output using verbosity=2, and found that the following occurs:

   * my-product is removed.
   * Cannot remove my-product-data, because another product depends on it.
   * my-product-libs removed.
   * ...opkg never checks my-product-data, even though my-product-libs depends on it!

It seems that while recursively removing packages, opkg forgets to re-check certain packages to see if they are now orphaned. This happens for several packages in my dependency hierarchy (but not all, curiously enough! Some now-orphaned packages are actually re-checked and removed).

The packages are left behind in the same way every time - easily reproducible.
Comment 1 Alejandro del Castillo 2016-01-12 23:14:00 UTC
Bug only reproduces with the internal solver, libsolv backend is fine.
Comment 2 Alejandro del Castillo 2018-12-20 23:35:33 UTC
De-prioritzing internalsolv bugs