Bug 294922 - pkg remove reports missing file in a non-existent path
Summary: pkg remove reports missing file in a non-existent path
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: Unspecified
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-pkg (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-05-01 01:22 UTC by jszhao
Modified: 2026-05-05 21:06 UTC (History)
7 users (show)

See Also:
linimon: maintainer-feedback? (pkg)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jszhao 2026-05-01 01:22:43 UTC
After pkg upgrade, I have found some compatibility libraries saved during the package upgrade:

root@epyc:~ # pkg info | grep backup
cpdup-1.22_1                   Comprehensive filesystem mirroring and backup program
libunibreak-backup-libunibreak.so.6-20260427091923 Compatibility libraries saved during package upgrade
openjph-backup-libopenjph.so.0.26-20260430094301 Compatibility libraries saved during package upgrade


I tried to remove them, and it finished without error; however, there is something strange:

root@epyc:~ # pkg remove *-backup-*
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 2 packages (of 0 packages in the universe):

Installed packages to be REMOVED:
        libunibreak-backup-libunibreak.so.6: 20260427091923
        openjph-backup-libopenjph.so.0.26: 20260430094301

Number of packages to be removed: 2

Proceed with deinstalling packages? [y/N]: y
[1/2] Deinstalling libunibreak-backup-libunibreak.so.6-20260427091923...
[1/2] Deleting files for libunibreak-backup-libunibreak.so.6-20260427091923:   0%
libunibreak-backup-libunibreak.so.6-20260427091923: missing file /root/usr/local/lib/compat/pkg/libunibreak.so.6
[1/2] Deleting files for libunibreak-backup-libunibreak.so.6-20260427091923: 100%
[2/2] Deinstalling openjph-backup-libopenjph.so.0.26-20260430094301...
[2/2] Deleting files for openjph-backup-libopenjph.so.0.26-20260430094301:   0%
openjph-backup-libopenjph.so.0.26-20260430094301: missing file /root/usr/local/lib/compat/pkg/libopenjph.so.0.26
[2/2] Deleting files for openjph-backup-libopenjph.so.0.26-20260430094301: 100%


The missing files are actually in /usr/local/lib/compat/pkg/, I don't know why /root is there.
Comment 1 jszhao 2026-05-01 01:24:06 UTC
root@epyc:~ # freebsd-version -kru
15.0-RELEASE-p7
15.0-RELEASE-p7
15.0-RELEASE-p7
root@epyc:~ # pkg -v
2.7.4
Comment 2 Mark Johnston freebsd_committer freebsd_triage 2026-05-01 16:59:15 UTC
This looks like it might have been addressed by https://github.com/freebsd/pkg/commit/c2b8976123157d2cd3194b6708d7b81dfed1e918 ?
Comment 3 Dag-Erling Smørgrav freebsd_committer freebsd_triage 2026-05-05 19:54:35 UTC
I think it's actually https://github.com/freebsd/pkg/commit/bbfc7b031237ae1bbb199bac427718418317e051 which is included in 2.7.5.
Comment 4 Ale 2026-05-05 20:49:12 UTC
Maybe the libraries for libunibreak were backed up because of this?
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=294450#c5

There has been a soname bump for libunibreak
https://cgit.freebsd.org/ports/commit/?id=b3a070f1551874388aec4b5c9380e0e0574a1eac
but despite the build has been tested with consumers, PORTREVISION was not bumped for them.
In my case I had to rebuild multimedia/libass.

About libopenjph, my only consumer is graphics/openexr which has been bumped with the graphics/openjph update, so I had no problem with it.
Try running
$ pkg shlib -qR libopenjph.so.0.26
Comment 5 Mark Millard 2026-05-05 20:53:56 UTC
There is also the upstream report against 2.7.5:

https://github.com/freebsd/pkg/issues/2666
("pkg 2.7.5: reports fstat related message involving //usr/home/root/usr/local/lib/compat/pkg but actual file path prefix was /usr/local/lib/compat/pkg")
Comment 6 Ale 2026-05-05 21:06:57 UTC
Sorry, I was focused on the backup packages and I completely missed the part about the error (or maybe just warning) about the missing files on the wrong path.