Date: Sun, 9 Jan 2011 12:48:47 +0200 From: Markiyan Kushnir <markiyan.kushnir@gmail.com> To: Giorgos Keramidas <keramida@ceid.upatras.gr> Cc: =?KOI8-U?B?68/O2MvP1yDl18fFzsnK?= <kes-kes@yandex.ru>, freebsd-questions@freebsd.org Subject: Re: How to clean system Message-ID: <AANLkTikLeCYqo4KLpGB3sdMoyrOfM5HCpjD3zbuFHPb%2B@mail.gmail.com> In-Reply-To: <xeiay66vt6y7.fsf@kobe.laptop> References: <155307659.20110108231807@yandex.ru> <xeiay66vt6y7.fsf@kobe.laptop>
next in thread | previous in thread | raw e-mail | index | archive | help
2011/1/8 Giorgos Keramidas <keramida@ceid.upatras.gr>: > On Sat, 8 Jan 2011 23:18:07 +0200, =EB=CF=CE=D8=CB=CF=D7 =E5=D7=C7=C5=CE= =C9=CA <kes-kes@yandex.ru> 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" >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTikLeCYqo4KLpGB3sdMoyrOfM5HCpjD3zbuFHPb%2B>