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.
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?
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.