pkg icon indicating copy to clipboard operation
pkg copied to clipboard

Autoremove options for 'pkg delete'

Open infracaninophile opened this issue 9 years ago • 8 comments

From Kris Moore's talk @BSDCan

Can we have an option that shows what could be autoremoved as a consequence of running pkg delete pkgname

Probably something like:

pkg delete -A pkgname

which would do the package deletion as usual, and then run autoremove, including asking for user confirmation on what to remove.

infracaninophile avatar Jun 13 '15 18:06 infracaninophile

I'm sure I missed the idea. But what a difference with pkg delete -n pkgname, since solver will remove all depends recursive on pkgname?

andrejzverev avatar Jun 14 '15 08:06 andrejzverev

On 14/06/2015 04:04, Andrej Z. wrote:

I'm sure I missed the idea. But what a difference with pkg delete -n pkgname, since solver will remove all depends recursive on pkgname?

Solver will remove anything that depends on pkgname if you 'pkg delete pkgname' (ie. it deletes the children of pkgname)

This is the other way round: it deletes anything pkgname depends on which is marked automatic and that nothing else depends on (ie. it deletes from amongst the parents of pkgname).

Matthew

infracaninophile avatar Jun 14 '15 13:06 infracaninophile

This is a great idea and I often miss the functionality. Especially, when trying to find the most suitable software among several options. It's not intuitive that installing package X also means installing of all its missing dependencies, but after (almost immediately) uninstalling X those dependencies will remain.

avg-I avatar Apr 22 '18 19:04 avg-I

Isn't it just the same as pkg remove foo && pkg autoremove?

arrowd avatar Mar 28 '23 06:03 arrowd

Isn't it just the same as pkg remove foo && pkg autoremove?

Yes, it is. Similarly to how sort -u acts the same as sort | uniq and to other convenience options and shortcuts.

avg-I avatar May 23 '23 10:05 avg-I

After a bit of thinking, no it isn't. Imagine we already have some auto packages that can be removed by autoremove. If we run pkg delete -A pkgname it will autoremove both newly introduced to-be-autoremoved packages as well as previous ones.

arrowd avatar May 23 '23 11:05 arrowd

Indeed. Very good point.

avg-I avatar May 23 '23 11:05 avg-I

I never said anything here, but yes this is a welcomed feature.

bapt avatar May 23 '23 11:05 bapt