As a part of the FreeBSD development lifecycle, files and their
contents occasionally become obsolete. This may be because
functionality is implemented elsewhere, the version number of
the library has changed, or it was removed from the system
entirely. This includes old files, libraries, and directories,
which should be removed when updating the system. The benefit
is that the system is not cluttered with old files which take up
unnecessary space on the storage and backup media.
Additionally, if the old library has a security or stability
issue, the system should be updated to the newer library to keep
it safe and to prevent crashes caused by the old library.
Files, directories, and libraries which are considered obsolete
are listed in /usr/src/ObsoleteFiles.inc.
The following instructions should be used to remove obsolete
files during the system upgrade process.
Follow the steps outlined in Section 25.7.1, “The Canonical Way to Update Your System”. After the
make
and the subsequent installworldmergemaster have finished
successfully, check for obsolete files and libraries as
follows:
# cd /usr/src
# make check-oldIf any obsolete files are found, they can be deleted using the following command:
# make delete-oldRefer to /usr/src/Makefile
for more targets of interest.
A prompt is displayed before deleting each obsolete file.
To skip the prompt and let the system remove these files
automatically, use
BATCH_DELETE_OLD_FILES:
# make -DBATCH_DELETE_OLD_FILES delete-oldThe same goal can be achieved by piping these commands
through yes:
# yes|make delete-oldDeleting obsolete files will break applications that
still depend on those obsolete files. This is especially true
for old libraries. In most cases, the programs, ports, or
libraries that used the old library need to be recompiled
before make
is
executed.delete-old-libs
Utilities for checking shared library dependencies are
available from the Ports Collection in
sysutils/libchk or sysutils/bsdadminscripts.
Obsolete shared libraries can conflict with newer libraries, causing messages like these:
To solve these problems, determine which port installed the library:
# pkg_info -W /usr/local/lib/libtiff.so
/usr/local/lib/libtiff.so was installed by package tiff-3.9.4
# pkg_info -W /usr/local/lib/libXext.so
/usr/local/lib/libXext.so was installed by package libXext-1.1.1,1Then deinstall, rebuild and reinstall the port. ports-mgmt/portmaster can be used to
automate this process. After all ports are rebuilt and no
longer use the old libraries, delete the old libraries using the
following command:
# make delete-old-libsThis, and other documents, can be downloaded from ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/
For questions about FreeBSD, read the
documentation before
contacting <questions@FreeBSD.org>.
For questions about this documentation, e-mail <doc@FreeBSD.org>.