Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Jan 2007 14:58:23 -0500
From:      John Nielsen <lists@jnielsen.net>
To:        freebsd-stable@freebsd.org
Cc:        Tom Judge <tom@tomjudge.com>
Subject:   Re: Removing unused core components. (Disabled in make.conf)
Message-ID:  <200701171458.23526.lists@jnielsen.net>
In-Reply-To: <200701171429.32081.lists@jnielsen.net>
References:  <45AE68DE.7060304@tomjudge.com> <utzypiiyy.fsf@indorsoft.ru> <200701171429.32081.lists@jnielsen.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wednesday 17 January 2007 14:29, John Nielsen wrote:
> On Wednesday 17 January 2007 13:52, Victor Snezhko wrote:
> > Tom Judge <tom@tomjudge.com> writes:
> > > Hi,
> > >
> > > I have the following options in /etc/make.conf:
> > >
> > > NO_PROFILE=true
> > > NO_SENDMAIL=true
> > > NO_GAMES=true
> > > NO_I4B=true
> > > NO_ATM=true
> > > NO_INET6=true
> > > NO_BLUETOOTH=true
> > > NO_IPFILTER=true
> > > NO_RCMDS=true
> > > NO_KERBEROS=true
> > >
> > >
> > > However after a "make buildworld installworld" the utilities and libs
> > > associated with these packages are still installed,  is there any easy
> > > way to remove them from the system?
> >
> > make delete-old
>
> That will delete obsolete files no longer used by the current version of
> the operating system, but it won't do what the OP is asking.
>
> I don't know of a one-step way to do what you're asking. You could do a
> find over the base system directories and look for files older than your
> last installworld. That might not fit the "easy" part of the request since
> you'd have to go over the list manually to make sure it wasn't killing
> anything you actually need, but it should be mostly accurate.

Here's a script I just put together to get a good first approximation of 
outdated files using the approach above. Change the variables to be 
appropriate for your situation, review the output file carefully before 
deleting anything, and use at your own risk. :)

=== start prune.sh ===
#!/bin/sh

DIRS="/bin /lib /libexec /rescue /sbin /usr/bin /usr/games /usr/lib \
        /usr/libdata /usr/libexec /usr/sbin"
OUTFILE=/usr/local/scripts/prune-files.txt
AGE="1 month"

rm -f ${OUTFILE}
for d in ${DIRS} ; do
        find ${d} -type f ! -newermt "${AGE} ago" >> ${OUTFILE}.tmp
done

grep -vF "lib/compat" ${OUTFILE}.tmp | grep -vi perl > ${OUTFILE}
rm -f ${OUTFILE}.tmp

=== end prune.sh ===

JN



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