How to safely clean out /lib, /usr/lib?

Matthew Dillon dillon at
Mon Oct 11 09:01:32 PDT 2004

:installworld and deleted all commands more than a month old or so, the=20
:logic being that any commands not updated by world are remnants that can be=
:purged.  Is that a reasonable assumption?
:Kirk Strauser

    I would also check the last access time of the libraries in question
    as a failsafe.  (note: the actual libraries, not the softlinks whos
    access times are not updated by the system).

    cd /usr/lib
    ls -ltua

    (this assumes you don't use 'tar' or 'cp' to backup your system, which
    would skew the results, and that you haven't already blown it by doing
    something right aweful in /usr/lib to open and read all the files :-).
    This also assumes that you are not using the 'noatime' mount flag for

    You can see whether a library is actually being used or not by looking
    at the last-accessed date (ls -u).  Or maybe run all your favorite
    applications first, exit them (so mmap accesses are updated properly),
    *then* check the last accessed dates on the libraries.

					Matthew Dillon 
					<dillon at>

More information about the freebsd-current mailing list