pkg icon indicating copy to clipboard operation
pkg copied to clipboard

'pkg autoremove' sometimes removes the pkg package even when it isn't marked as automatic

Open yurivict opened this issue 1 year ago • 4 comments

This doesn't happen every time, but it does happen. This possibly depends on the set of packages that are removed.

pkg-1.21.3 FreeBSD 14.0 STABLE

yurivict avatar Dec 06 '24 03:12 yurivict

are you able to reproduce ? is there any trace or anything about it you can provide?

bapt avatar Jan 22 '25 10:01 bapt

I will post an update if/once I will be able to reproduce this issue again.

yurivict avatar Jan 22 '25 16:01 yurivict

Yes, I can reproduce with pkg-1.21.3

I think I know what exactly happens.

Initially pkg is set to auto=false. But later pkg upgrades itself and changes it to auto=true.

Then pkg autoremove removes it.

The core problem description is: pkg should preserve the auto flag on packages that it upgrades or re-installs in the process of updating other packages.

yurivict avatar Jan 24 '25 05:01 yurivict

pkg upgrades itself

To which version?

FWIW I have not found a change to the automatic flag with any upgrade to 2.⋯ (typically 2.0.6).

grahamperrin avatar Mar 22 '25 04:03 grahamperrin