Bug 15821

Summary: Empty directory is removed when directory is a symlink
Product: [Yocto Project Subprojects] opkg Reporter: Mikael Pahmp <mikael.pahmp>
Component: opkgAssignee: Alex Stewart <alex.stewart>
Status: ACCEPTED --- QA Contact:
Severity: normal    
Priority: Medium    
Version: 0.6.3   
Target Milestone: next-patch   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description Mikael Pahmp 2025-04-03 13:55:28 UTC
When an ipk package installs things into a directory and that directoy is actually a symlink to another directory, when the package is removed and was the only package to put things in that directory, opkg removes the symlink even though it points to a non-empty directory.

This happens for instance when installing into /lib which is often a symlink to /usr/lib.

This is not a problem when upgrading the only package having files in a directory, as long as the new version also have things in that directory, but if the new version doesn't, the symlink is removed. This is an issue when adapting a package to not install into /lib but instead install into /usr/lib.
Comment 1 Alex Stewart 2025-04-07 18:16:50 UTC
Thanks for the bug, Mikael.

Do you know how dpkg handles cases like this?

And also, I assume this bug is in an opkg release from after we added the autoremove functionality. But what version are you using specifically?
Comment 2 Mikael Pahmp 2025-04-10 10:04:56 UTC
Correction. This was not version 1.0 of opkg. It was 0.6.3 (not available to select among versions above) selected by yocto 5.0.7.

I do not know how dpkg handles this.