automatic created backup packages - how to remove them?

A pkg info | grep backup | grep Compatibility tells me that I've got 73 automatic created backup packages installed by upgrading via pkg to 15.1; They look like this:

gimp3-app-backup-libgimp-3.0.so.0-20260713090759
gimp3-app-backup-libgimp-scriptfu-3.0.so.0-20260713090759
gimp3-app-backup-libgimpbase-3.0.so.0-20260713090759


pkg autoremove won't delete them, but they have no dependency and aren't needed (anymore). So… how to remove them all? There should be an easy way for the end user who uses packages without writing scripts or complex shell commands…

Edit: they are not created by upgrading to 15.1, but by upgrading to the third quarterly 2026…
 
Try this "pkg info | grep backup | grep Compatibility|cut -f1 -d' '|xargs pkg remove -y". There should probably be a shortcut for this....
Of course your command works (thanks), but using grep for names (like I did and took over by your command) isn't a real solution to be used as a nobrainer for everyone - it might fail (and "-y" deletes without the user being able to abort the process). IMO such packages need a flag in the pkg database to be selected and deleted. Otherwise users will end up with hundreds of orphaned packages… (deleting all orphaned packages is also not a solution). And as they are automatic installed they should be marked as such.
 
I haven't tested this because my system doesn't have that package, but what happens if you run the following?
pkg query -a %n\\t%m|grep root@localhost|awk '{ print $1 }'
 
I haven't tested this because my system doesn't have that package, but what happens if you run the following?
pkg query -a %n\\t%m|grep root@localhost|awk '{ print $1 }'
I've already deleted those packages even on the last machine, so I cannot try anything more.

But I've asked for an end-user solution, not for the coolest command line the average user doesn't understand and copy&pastes (never a good idea). Don't get me wrong, a big thank you for all those people enhanced pkg over the last years, and I think things like pkg for the base system is great - but all those work seems to me like it is a little bit unfinished so far: Previous I never got packages on my system I didn't said "ok" to, and the upgrade process to 15.1 was way more complex as expected.
 
What do you use to upgrade your packages? Because a plain pkg upgrade won't create those backup packages.
 
jmos
pkg delete -g '*-backup-*'
Make sure you examine the list and you're not deleting any backup utility you want.

SirDice it does. I this started happening for me on 15.0. I used pkgbasify to convert to pkgbase, so I don't know if that has anything to do with it.
 
It states that it will be removed by `autoremove`.
Code:
Now pkg backup libraries in packages lib by lib into individual packages

<name>-backup-<libname.so.X> they are registered as automated so once
they are not used anymore they are removed by pkg autoremove
 
Looks like you’re volunteering….
I'm not firm with the C languages, so I'm unable to get involved developing pkg.
pkg delete -g '*-backup-*'
*fck*… I forgot the quotes on my test using the "-g" parameter after looking in the man page…
It states that it will be removed by `autoremove`.
Here a autoremove didn't touched them, and a delete didn't complain any dependency. I can't see which pkg version this commit gets, but the last two ones in the quarterly branch didn't worked that way.

Edit: commit goes to pkg version 2.7.5 - afair I got this version with the 3/2026 branch ("these days"). So whoever uses the default (pkg quarterly) can't use the autoremove option to get rid of those package leftovers. Not a bug, but IMO a gap.
 
SirDice it does. I this started happening for me on 15.0. I used pkgbasify to convert to pkgbase, so I don't know if that has anything to do with it.
I think pkgbase does have something to do with it. I've been using stock freebsd-update for a while, across releases/major upgrades and have never seen a pkg upgrade creating backup packages.
Perhaps the default behavior change that Charlie_ links is the root cause. It says it was committed Mar 6, commit 0014e8b
 
Hi, I’ve observed another phenomenon involving "autoremove" on a strictly minimal installation (all boxes unchecked) of 15.1 STABLE.
When using pkg upgrade --autoremove , the system repeatedly attempts to install "llvm19-lite" even though a current version of "llvm19" is already installed; if you proceed with the operation, the "lite" version is simply discarded and deleted after being downloaded.
Again and again.
However, this doesn't happen when I use pkg upgrade && pkg autoremove instead. Nor does it occur with my "normal" installation on another machine with pkg upgrade --autoremove .
So I changed my behavior and it's not a real problem, but I found it quite strange.
 
Back
Top