From owner-freebsd-questions@FreeBSD.ORG Wed Jun 3 09:26:22 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 E03B7106568F for ; Wed, 3 Jun 2009 09:26:22 +0000 (UTC) (envelope-from dan.naumov@gmail.com) Received: from yw-out-2324.google.com (yw-out-2324.google.com [74.125.46.30]) by mx1.freebsd.org (Postfix) with ESMTP id 973228FC26 for ; Wed, 3 Jun 2009 09:26:22 +0000 (UTC) (envelope-from dan.naumov@gmail.com) Received: by yw-out-2324.google.com with SMTP id 9so4686034ywe.13 for ; Wed, 03 Jun 2009 02:26:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=xWIEkBSH3hImm18fBERgtxxYz63av/gCmErvxphkDDc=; b=JFLIP6vL+C+hkofdAudCY/+L3Tjrm6iA6oArkAZpIXaTK2Px0hhMUyl9RYy4BwFv2+ dRBS5UmTwY4uvrBdBHTVszj12AgMU362sFlxGNEQdbEm/UkO3hqR1n2jH53dmCknFwAf hEHwjY/5sjFM0QHVhoYP7+66pgVR1W8RaYUnA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=Yv+Fybufy3TCVJ+W/1u5OAuir5mUVmul60L58NYQs0WeS2fHMCh9jtc9xV0jKhcRTO L2V38Y320Ke7w2E+F6vmJrhUl7MlHVM4mknr1UO5+MG2AQHaOEzPgF/0XzmwgCcY6mQr wdwiWIv9ripJRsmY3ciliKuJT9nNRUI7C4b0Y= MIME-Version: 1.0 Received: by 10.100.172.16 with SMTP id u16mr779098ane.85.1244021181883; Wed, 03 Jun 2009 02:26:21 -0700 (PDT) In-Reply-To: References: Date: Wed, 3 Jun 2009 12:26:21 +0300 Message-ID: From: Dan Naumov To: Wojciech Puchar Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: 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: Wed, 03 Jun 2009 09:26:23 -0000 Thanks a lot, this worked like a charm! - Dan Naumov On Wed, Jun 3, 2009 at 12:09 PM, 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. >