pkg_deinstall: "delete all packages installed, except for X, Y and Z"

Dan Naumov dan.naumov at gmail.com
Wed Jun 3 09:26:23 UTC 2009


Thanks a lot, this worked like a charm!

- Dan Naumov


On Wed, Jun 3, 2009 at 12:09 PM, Wojciech
Puchar<wojtek at wojtek.tensor.gdynia.pl> wrote:
>> Hello list.
>>
>> I am trying to clean up a system with a LOT of cruft. Is there some
>> argument I could pass to pkg_deinstall that would result in "delete
>> all packages installed, except for X, Y and Z" (and obviously their
>> dependancies)?
>
> just do
>
> pkg_info |cut -f 1 -d " " >/tmp/pkglist
> edit pkglist and delete lines X, Y and Z
>
> do
>
> pkg_delete `cat /tmp/pkglist`
> rm /tmp/pkglist
>
> ignore errors about package can't be deleted because X, Y or Z requires it.
> it's exactly what you want.
>


More information about the freebsd-questions mailing list