Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 04 Jun 2009 18:53:56 +0800
From:      Fbsd1 <fbsd1@a1poweruser.com>
To:        Wojciech Puchar <wojtek@wojtek.tensor.gdynia.pl>
Cc:        Dan Naumov <dan.naumov@gmail.com>, freebsd-questions@freebsd.org
Subject:   Re: pkg_deinstall: "delete all packages installed, except for X, Y and Z"
Message-ID:  <4A27A7C4.20803@a1poweruser.com>
In-Reply-To: <alpine.BSF.2.00.0906031108520.50563@wojtek.tensor.gdynia.pl>
References:  <cf9b1ee00906030138w148c923j67f7422491bf5cb2@mail.gmail.com> <alpine.BSF.2.00.0906031108520.50563@wojtek.tensor.gdynia.pl>

next in thread | previous in thread | raw e-mail | index | archive | help
Wojciech Puchar 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.
> 
> 
pkg_delete `cat /tmp/pkglist`  gives error 'no such package `cat 
/tmp/pkglist` installed



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4A27A7C4.20803>