From owner-freebsd-questions@FreeBSD.ORG Sun Jan 9 11:13:52 2011 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 8DA081065672 for ; Sun, 9 Jan 2011 11:13:52 +0000 (UTC) (envelope-from markiyan.kushnir@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 5464D8FC13 for ; Sun, 9 Jan 2011 11:13:52 +0000 (UTC) Received: by iwn39 with SMTP id 39so18744512iwn.13 for ; Sun, 09 Jan 2011 03:13:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=PU3a3F26Kdn1e7DxoG+5d4U06n8j15r9MMIt1OvRbW4=; b=XVOowrdAQO0QsLxbx2PJ1gsbUXiPWxYDWWIEaVlsYedSQda6+6hluvxkmSCD92oY6V rrI1fwL1wJycR32v+CLDdQMbNx9ltJfslUUk1N2CF3z46U/cK3w9qKaDm4FdOS93ra2C wqpRVPvJ9QERpSLai1aBKIeVkCVlfWyRfHWCk= 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=nmfZPZvwsiSpRYEDt2jMlkdO8nPynoRnDybWnaw+c9z554A9XQzR1T+8FoosbZXP3f Ys44vCkNhHORtUcX2xmdeJEJD7zi9qS46+uzyVo0Kn5a47g4F3ypbAZbeKU1i5u+wAT9 JTHwxX8CwppJhe8cGPl91+LDSWXV0PkIkF6JE= MIME-Version: 1.0 Received: by 10.231.15.133 with SMTP id k5mr26779119iba.187.1294570127843; Sun, 09 Jan 2011 02:48:47 -0800 (PST) Received: by 10.231.147.131 with HTTP; Sun, 9 Jan 2011 02:48:47 -0800 (PST) In-Reply-To: References: <155307659.20110108231807@yandex.ru> Date: Sun, 9 Jan 2011 12:48:47 +0200 Message-ID: From: Markiyan Kushnir To: Giorgos Keramidas Content-Type: text/plain; charset=KOI8-U Content-Transfer-Encoding: quoted-printable Cc: =?KOI8-U?B?68/O2MvP1yDl18fFzsnK?= , freebsd-questions@freebsd.org Subject: Re: How to clean system 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: Sun, 09 Jan 2011 11:13:52 -0000 2011/1/8 Giorgos Keramidas : > On Sat, 8 Jan 2011 23:18:07 +0200, =EB=CF=CE=D8=CB=CF=D7 =E5=D7=C7=C5=CE= =C9=CA wrote: >> Hi >> System have many programs. >> Wanna to upgrade to new version of FBSD >> >> Is it possible to clean system from garbage (all programs, files, >> header files, except configuration files) >> like installing FBSD from CD? >> >> is there cmd? >> make clean-system > > No, there's no such command. =9AIf you are looking for a way to 'deinstal= l > all ports & packages' though, it may be as easy as: > > 1. Remove all the currently installed ports: > > =9A =9A# rm -fr /usr/local > =9A =9A# mkdir /usr/local && cd /usr/local > =9A =9A# mtree -deU < /etc/mtree/BSD.local.dist > Deleting /usr/local will also delete /usr/local/etc -- which might be not what the OP expects given the "except configuration files". I would still follow the pkg_delete path, along with some other actions: - if you have fusefs, ntfs-3g, linprocfs, etc in your /etc/fstab -- unmount and comment out temporarily - if you have third party services in your /etc/rc.conf[.local] -- stop and comment out - if you have third party modules in /boot/loader.conf -- the same thing % pkg_delete -adf % rm -R /usr/local/lib/compat/pkg % rm -R /var/db/pkg/* # if anything was left there % rm -R /var/db/ports/* #if you want to clean up your ports' configurations % rm -R /usr/ports/distfiles/* # not sure if you need it, but I do it in some cases... % rm -R /usr/obj Check /usr/local and /usr/compat to see if you want to remove anything from there manually. You might want to clean up /usr/local/include, /usr/compat/linux/var, /usr/compat/linux/usr/local, /usr/local/bin (?), /usr/local/info ... etc. OTOH, I always preserve /usr/local/lib/X11/fonts -- I have some custom fonts stored there, /usr/local/share/stardict -- custom dictionaries I want to survive across upgrade ... etc. I also place in /etc/mergemaster.rc something I want to preserve: /etc/master.passwd /etc/group /etc/ppp/ppp.conf /etc/syslog.conf /etc/sysctl.conf /etc/hosts /etc/namedb/named.conf Regarding this last item, it might not always be the best way to do, since sometimes it might be necessary to upgrade some of the default settings in these files. Then you can build and install the base system and the ports you need. Almost all of these steps are easy to automate. Thanks, Markiyan. > 2. Remove all the information about 'installed packages', because you > =9A don't have any of these anymore: > > =9A =9A# rm -fr /var/db/pkg/* > > 3. Optionally, if you are going to reconfigure all your ports from > =9A scratch, remove the saved port configuration options: > > =9A =9A# rm -fr /var/db/ports/* > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.o= rg" >