From owner-freebsd-questions@FreeBSD.ORG Thu Jun 4 10:54:21 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5FA7B1065673 for ; Thu, 4 Jun 2009 10:54:21 +0000 (UTC) (envelope-from fbsd1@a1poweruser.com) Received: from mail-03.name-services.com (mail-03.name-services.com [69.64.155.195]) by mx1.freebsd.org (Postfix) with ESMTP id 484E98FC0A for ; Thu, 4 Jun 2009 10:54:16 +0000 (UTC) (envelope-from fbsd1@a1poweruser.com) Received: from [10.0.10.6] ([202.69.174.228]) by mail-03.name-services.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 4 Jun 2009 03:53:59 -0700 Message-ID: <4A27A7C4.20803@a1poweruser.com> Date: Thu, 04 Jun 2009 18:53:56 +0800 From: Fbsd1 User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: Wojciech Puchar References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 04 Jun 2009 10:54:00.0213 (UTC) FILETIME=[C4421450:01C9E502] X-Sender: fbsd1@a1poweruser.com Cc: Dan Naumov , freebsd-questions@freebsd.org Subject: Re: pkg_deinstall: "delete all packages installed, except for X, Y and Z" X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jun 2009 10:54:21 -0000 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