From owner-freebsd-questions@freebsd.org Wed Dec 9 04:12:54 2015 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 467949D5F5C for ; Wed, 9 Dec 2015 04:12:54 +0000 (UTC) (envelope-from drosih@rpi.edu) Received: from smtp10.server.rpi.edu (smtp10.server.rpi.edu [128.113.2.230]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "canit.localdomain", Issuer "canit.localdomain" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E63531782 for ; Wed, 9 Dec 2015 04:12:53 +0000 (UTC) (envelope-from drosih@rpi.edu) Received: from smtp-auth2.server.rpi.edu (route.canit.rpi.edu [128.113.2.232]) by smtp10.server.rpi.edu (8.14.3/8.14.3/Debian-9.4) with ESMTP id tB944cOV012112 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 8 Dec 2015 23:04:38 -0500 Received: from smtp-auth2.server.rpi.edu (localhost [127.0.0.1]) by smtp-auth2.server.rpi.edu (Postfix) with ESMTP id 71D16180DD; Tue, 8 Dec 2015 23:04:38 -0500 (EST) Received: from [128.113.24.47] (gilead-qc124.netel.rpi.edu [128.113.124.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: drosih) by smtp-auth2.server.rpi.edu (Postfix) with ESMTPSA id ABDE61800C; Tue, 8 Dec 2015 23:04:34 -0500 (EST) From: "Garance A Drosehn" To: "Matthias Apitz" Cc: freebsd-questions@freebsd.org Subject: Re: remove all installed packages Date: Tue, 08 Dec 2015 23:04:51 -0500 Message-ID: <81ADFEB6-0A6A-4AEA-813C-227BED22629A@rpi.edu> In-Reply-To: <20151208200303.GA2194@c720-r285885-amd64> References: <20151208200303.GA2194@c720-r285885-amd64> MIME-Version: 1.0 X-Mailer: MailMate (1.9.2r5130) X-Virus-Scanned: ClamAV using ClamSMTP X-Bayes-Prob: 0.0001 (Score 0, tokens from: outgoing, @@RPTN) X-Spam-Score: 0.00 () [Hold at 10.10] X-CanIt-Incident-Id: 03PPg4Clq X-CanIt-Geo: ip=128.113.124.17; country=US; region=New York; city=Troy; latitude=42.7495; longitude=-73.5951; http://maps.google.com/maps?q=42.7495,-73.5951&z=6 X-CanItPRO-Stream: outgoing X-Canit-Stats-ID: Bayes signature not available X-Scanned-By: CanIt (www . roaringpenguin . com) on 128.113.2.230 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2015 04:12:54 -0000 On 8 Dec 2015, at 15:03, Matthias Apitz wrote: > Hello, > > Is it enough to remove all installed packages, just doing > > # rm -f /usr/local/* > # rm -f /var/db/pkg/* > > Anything else? I've done this from time-to-time to rebuild and modernize all of my ports, and to also make sure that I have removed all old cruft. The process I do has more steps than what you are planning to do, but that is basically what I do. There are a few risks in doing it the way you have there. You may end up removing some binaries that you will wish you had if something does go wrong. At the very least, I recommend that you save a copy of everything in /usr/local/etc in /usr/BAK-local/etc in case you'll need some configuration file that you don't realize you will need. And if you have enough space, also save /usr/local/bin in /usr/BAK-local/bin. After you have everything rebuilt then you won't care about the copies, but they might come in very useful if something goes haywire. I'd also suggest that you do the removing in one session, and then start a brand new login session before you start to build (or otherwise install) the first port that you want. That way you'll know the new session is not depending on anything which is in the older version of /usr/local. If you have a lot of available space which you could use to create some new partitions, then I could tell you the longer process which I go through. I also get rid of everything at once (instead of asking pkg to deinstall each package), but I do it in a way where I don't have to commit to the newly rebuilt /usr/local until I'm pretty sure that everything in it is working, and that I haven't lost anything. -- Garance Alistair Drosehn = drosih@rpi.edu Senior Systems Programmer or gad@FreeBSD.org Rensselaer Polytechnic Institute; Troy, NY; USA