Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 09 Jan 2011 01:03:06 +0100
From:      keramida@freebsd.org (Giorgos Keramidas)
To:        =?utf-8?B?0JrQvtC90YzQutC+0LIg0JXQstCz0LXQvdC40Lk=?= <kes-kes@yandex.ru>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: How to clean system
Message-ID:  <xeiatyhjlz9h.fsf@kobe.laptop>
In-Reply-To: <1801316867.20110108234124@yandex.ru> (=?utf-8?B?ItCa0L7QvdGM?= =?utf-8?B?0LrQvtCyINCV0LLQs9C10L3QuNC5Iidz?= message of "Sat, 8 Jan 2011 23:41:24 %2B0200")
References:  <155307659.20110108231807@yandex.ru> <xeiay66vt6y7.fsf@kobe.laptop> <1801316867.20110108234124@yandex.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 8 Jan 2011 23:41:24 +0200, =D0=9A=D0=BE=D0=BD=D1=8C=D0=BA=D0=BE=D0=
=B2 =D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9 <kes-kes@yandex.ru> wrote:
> GK> On Sat, 8 Jan 2011 23:18:07 +0200, =D0=9A=D0=BE=D0=BD=D1=8C=D0=BA=D0=
=BE=D0=B2 =D0=95=D0=B2=D0=B3=D0=B5=D0=BD=D0=B8=D0=B9 <kes-kes@yandex.ru> wr=
ote:
>>> 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
>
> GK> No, there's no such command.  If you are looking for a way to 'deinst=
all
> GK> all ports & packages' though, it may be as easy as:
>
> GK> 1. Remove all the currently installed ports:
>
> GK>     # rm -fr /usr/local
> GK>     # mkdir /usr/local && cd /usr/local
> GK>     # mtree -deU < /etc/mtree/BSD.local.dist
>
> GK> 2. Remove all the information about 'installed packages', because you
> GK>    don't have any of these anymore:
>
> GK>     # rm -fr /var/db/pkg/*
>
> GK> 3. Optionally, if you are going to reconfigure all your ports from
> GK>    scratch, remove the saved port configuration options:
>
> GK>     # rm -fr /var/db/ports/*
>
> I have tried: pkg_delete -a
> but many files are left in /usr/bin  /usr/sbin   ... (((
> also there are files from old 7.2 system, now I have 9.0

Packages should never install stuff in /usr/bin and /usr/sbin.  Ports
should *only* install files in /usr/local/... There are a few ports that
includes options to override base-system files in /usr but these are the
exception.

If you have been upgrading from source from 7.2 then you should also
have a look at the `/usr/src/UPDATING' file; especially at the help
about the 'make delete-old' targets of the source makefiles.

Most of the cruft left behind from old, obsolete stuff can be deleted by
running

    # cd /usr/src
    # make delete-old

and following the prompts.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?xeiatyhjlz9h.fsf>