delete-old status under /usr/ (amd64 context example)

From: Mark Millard <marklmi_at_yahoo.com>
Date: Fri, 28 Jul 2023 16:57:17 UTC
I created a /tmp/main-amd64-installed-from-scratch/ and installed into it
with:

installworld distrib-dirs distribution DB_FROM_SRC=1 installkernel

in a boot context with:

# uname -apKU
FreeBSD amd64-ZFS 14.0-CURRENT FreeBSD 14.0-CURRENT amd64 1400093 #106 main-n264334-215bab7924f6-dirty: Tue Jul 25 18:49:51 PDT 2023     root@amd64-ZFS:/usr/obj/BUILDs/main-amd64-nodbg-clang/usr/main-src/amd64.amd64/sys/GENERIC-NODBG amd64 amd64 1400093 1400093

I use delete-old and delete-old-libs with -DBATCH_DELETE_OLD_FILES
in my update procedures and have for years. delete-old use is a
step in scripts, not a manual operation. (delete-old-libs use
requires more timing control and so is less automatic.)

I find the following when I look for potential old files in /usr/ compared
to what ended up in /tmp/main-amd64-installed-from-scratch/usr/ . Much of
the output seems to be old files that are still around but likely should
not be.

# diff -rq /tmp/main-amd64-installed-from-scratch/usr /usr \
| grep "Only in /usr/" | grep -v -E "(/usr/local:|/usr/obj:|/usr/lib/debug/boot: kernel\.)"
diff: /tmp/main-amd64-installed-from-scratch/usr/share/locale/nn_NO.ISO8859-1/LC_MESSAGES: Too many levels of symbolic links
diff: /tmp/main-amd64-installed-from-scratch/usr/share/locale/nn_NO.ISO8859-15/LC_MESSAGES: Too many levels of symbolic links
diff: /tmp/main-amd64-installed-from-scratch/usr/share/locale/sl_SI.ISO8859-2/LC_MESSAGES: No such file or directory
Only in /usr/include/dev/hwpmc: hwpmc_beri.h
Only in /usr/include/dev/wg: compat.h
Only in /usr/include/dev/wg: crypto.h
Only in /usr/include/dev/wg: version.h
Only in /usr/include/dev/wg: wg_cookie.h
Only in /usr/include/dev/wg: wg_noise.h
Only in /usr/include/machine: ppireg.h
Only in /usr/include/machine: timerreg.h
Only in /usr/include/sys: _cscan_atomic.h
Only in /usr/include/sys: _cscan_bus.h
Only in /usr/lib/debug/usr/bin: timeout.debug
Only in /usr/lib/debug/usr/tests/cddl/usr.sbin/dtrace/amd64: kinst
Only in /usr/lib/debug/usr/tests/usr.bin: timeout
Only in /usr/lib/include/dev/hwpmc: hwpmc_beri.h
Only in /usr/lib/include/dev/wg: compat.h
Only in /usr/lib/include/dev/wg: crypto.h
Only in /usr/lib/include/dev/wg: version.h
Only in /usr/lib/include/dev/wg: wg_cookie.h
Only in /usr/lib/include/dev/wg: wg_noise.h
Only in /usr/lib/include/machine: ppireg.h
Only in /usr/lib/include/machine: timerreg.h
Only in /usr/lib/include/sys: _cscan_atomic.h
Only in /usr/lib/include/sys: _cscan_bus.h
Only in /usr/share/certs/trusted: Camerfirma_Chambers_of_Commerce_Root.pem
Only in /usr/share/certs/trusted: Camerfirma_Global_Chambersign_Root.pem
Only in /usr/share/certs/trusted: Certum_Root_CA.pem
Only in /usr/share/certs/trusted: Chambers_of_Commerce_Root_-_2008.pem
Only in /usr/share/certs/trusted: D-TRUST_Root_CA_3_2013.pem
Only in /usr/share/certs/trusted: EC-ACC.pem
Only in /usr/share/certs/trusted: GeoTrust_Primary_Certification_Authority_-_G2.pem
Only in /usr/share/certs/trusted: Global_Chambersign_Root_-_2008.pem
Only in /usr/share/certs/trusted: OISTE_WISeKey_Global_Root_GA_CA.pem
Only in /usr/share/certs/trusted: QuoVadis_Root_CA.pem
Only in /usr/share/certs/trusted: Sonera_Class_2_Root_CA.pem
Only in /usr/share/certs/trusted: Staat_der_Nederlanden_Root_CA_-_G3.pem
Only in /usr/share/certs/trusted: SwissSign_Platinum_CA_-_G2.pem
Only in /usr/share/certs/trusted: Symantec_Class_1_Public_Primary_Certification_Authority_-_G6.pem
Only in /usr/share/certs/trusted: Symantec_Class_2_Public_Primary_Certification_Authority_-_G6.pem
Only in /usr/share/certs/trusted: Trustis_FPS_Root_CA.pem
Only in /usr/share/certs/trusted: VeriSign_Universal_Root_Certification_Authority.pem
Only in /usr/share/certs/trusted: Verisign_Class_1_Public_Primary_Certification_Authority_-_G3.pem
Only in /usr/share/certs/trusted: Verisign_Class_2_Public_Primary_Certification_Authority_-_G3.pem
Only in /usr/share/locale/hr_HR.ISO8859-2: LC_MESSAGES
Only in /usr/share/locale/nl_BE.ISO8859-1: LC_MESSAGES
Only in /usr/share/locale/nl_BE.ISO8859-15: LC_MESSAGES
Only in /usr/share/locale/sr_RS.ISO8859-2: LC_MESSAGES
Only in /usr/share/locale/zh_TW.Big5: LC_NUMERIC
Only in /usr/share/man/man4/aarch64: aw_gpio.4.gz
Only in /usr/share/man/man4/aarch64: aw_mmc.4.gz
Only in /usr/share/man/man4/aarch64: aw_rtc.4.gz
Only in /usr/share/man/man4/aarch64: aw_sid.4.gz
Only in /usr/share/man/man4/aarch64: aw_spi.4.gz
Only in /usr/share/man/man4/aarch64: aw_syscon.4.gz
Only in /usr/share/man/man4/aarch64: bcm283x_pwm.4.gz
Only in /usr/share/man/man4: ce.4.gz
Only in /usr/share/man/man4: cp.4.gz
Only in /usr/share/man/man4/i386: ce.4.gz
Only in /usr/share/man/man4/i386: cp.4.gz
Only in /usr/share/man/man4: if_an.4.gz
Only in /usr/share/man/man5: portsnap.conf.5.gz
Only in /usr/share/man/man8: apm.8.gz
Only in /usr/share/man/man8: apmconf.8.gz
diff: /tmp/main-amd64-installed-from-scratch/usr/tests/local: No such file or directory
diff: /tmp/main-amd64-installed-from-scratch/usr/tests/sys/pjdfstest/tests/tests/tests/tests/tests/tests/tests/tests/tests/tests/tests/tests/tests/tests/tests/tests/tests/tests/tests/tests/tests/tests/tests/tests/tests/tests/tests/tests/tests/tests/tests/tests/tests: Too many levels of symbolic links
Only in /usr/share/man/man9: DOMAIN_SET.9.gz
Only in /usr/share/man/man9: vm_page_sbusy.9.gz
Only in /usr/share/man/man9: vm_page_sleep_if_busy.9.gz
Only in /usr/share/man/man9: vm_page_xbusy.9.gz
Only in /usr/share/openssl/man/man1: asn1parse.1.gz
Only in /usr/share/openssl/man/man1: ca.1.gz
Only in /usr/share/openssl/man/man1: ciphers.1.gz
Only in /usr/share/openssl/man/man1: cms.1.gz
Only in /usr/share/openssl/man/man1: crl.1.gz
Only in /usr/share/openssl/man/man1: crl2pkcs7.1.gz
Only in /usr/share/openssl/man/man1: dgst.1.gz
Only in /usr/share/openssl/man/man1: dhparam.1.gz
Only in /usr/share/openssl/man/man1: dsa.1.gz
Only in /usr/share/openssl/man/man1: dsaparam.1.gz
Only in /usr/share/openssl/man/man1: ec.1.gz
Only in /usr/share/openssl/man/man1: ecparam.1.gz
Only in /usr/share/openssl/man/man1: enc.1.gz
Only in /usr/share/openssl/man/man1: engine.1.gz
Only in /usr/share/openssl/man/man1: errstr.1.gz
Only in /usr/share/openssl/man/man1: gendsa.1.gz
Only in /usr/share/openssl/man/man1: genpkey.1.gz
Only in /usr/share/openssl/man/man1: genrsa.1.gz
Only in /usr/share/openssl/man/man1: list.1.gz
Only in /usr/share/openssl/man/man1: nseq.1.gz
Only in /usr/share/openssl/man/man1: ocsp.1.gz
Only in /usr/share/openssl/man/man1: openssl-tsget.1.gz
Only in /usr/share/openssl/man/man1: passwd.1.gz
Only in /usr/share/openssl/man/man1: pkcs12.1.gz
Only in /usr/share/openssl/man/man1: pkcs7.1.gz
Only in /usr/share/openssl/man/man1: pkcs8.1.gz
Only in /usr/share/openssl/man/man1: pkey.1.gz
Only in /usr/share/openssl/man/man1: pkeyparam.1.gz
Only in /usr/share/openssl/man/man1: pkeyutl.1.gz
Only in /usr/share/openssl/man/man1: prime.1.gz
Only in /usr/share/openssl/man/man1: rand.1.gz
Only in /usr/share/openssl/man/man1: req.1.gz
Only in /usr/share/openssl/man/man1: rsa.1.gz
Only in /usr/share/openssl/man/man1: rsautl.1.gz
Only in /usr/share/openssl/man/man1: s_client.1.gz
Only in /usr/share/openssl/man/man1: s_server.1.gz
Only in /usr/share/openssl/man/man1: s_time.1.gz
Only in /usr/share/openssl/man/man1: sess_id.1.gz
Only in /usr/share/openssl/man/man1: smime.1.gz
Only in /usr/share/openssl/man/man1: speed.1.gz
Only in /usr/share/openssl/man/man1: spkac.1.gz
Only in /usr/share/openssl/man/man1: srp.1.gz
Only in /usr/share/openssl/man/man1: storeutl.1.gz
Only in /usr/share/openssl/man/man1: ts.1.gz
Only in /usr/share/openssl/man/man1: verify.1.gz
Only in /usr/share/openssl/man/man1: version.1.gz
Only in /usr/share/openssl/man/man1: x509.1.gz
Only in /usr/share/openssl/man/man3: ECDH_get_ex_data.3.gz
Only in /usr/share/openssl/man/man3: ECDH_get_ex_new_index.3.gz
Only in /usr/share/openssl/man/man3: ECDH_set_ex_data.3.gz
Only in /usr/share/openssl/man/man3: ERR_GET_FUNC.3.gz
Only in /usr/share/openssl/man/man3: EVP_PKEY_CTX_hkdf_mode.3.gz
Only in /usr/share/openssl/man/man3: EVP_PKEY_set_alias_type.3.gz
Only in /usr/share/openssl/man/man3: EVP_aes.3.gz
Only in /usr/share/openssl/man/man3: EVP_aria.3.gz
Only in /usr/share/openssl/man/man3: EVP_camellia.3.gz
Only in /usr/share/openssl/man/man3: EVP_des.3.gz
Only in /usr/share/openssl/man/man3: RAND_DRBG_bytes.3.gz
Only in /usr/share/openssl/man/man3: RAND_DRBG_cleanup_entropy_fn.3.gz
Only in /usr/share/openssl/man/man3: RAND_DRBG_cleanup_nonce_fn.3.gz
Only in /usr/share/openssl/man/man3: RAND_DRBG_free.3.gz
Only in /usr/share/openssl/man/man3: RAND_DRBG_generate.3.gz
Only in /usr/share/openssl/man/man3: RAND_DRBG_get0_master.3.gz
Only in /usr/share/openssl/man/man3: RAND_DRBG_get0_private.3.gz
Only in /usr/share/openssl/man/man3: RAND_DRBG_get0_public.3.gz
Only in /usr/share/openssl/man/man3: RAND_DRBG_get_entropy_fn.3.gz
Only in /usr/share/openssl/man/man3: RAND_DRBG_get_ex_data.3.gz
Only in /usr/share/openssl/man/man3: RAND_DRBG_get_ex_new_index.3.gz
Only in /usr/share/openssl/man/man3: RAND_DRBG_get_nonce_fn.3.gz
Only in /usr/share/openssl/man/man3: RAND_DRBG_instantiate.3.gz
Only in /usr/share/openssl/man/man3: RAND_DRBG_new.3.gz
Only in /usr/share/openssl/man/man3: RAND_DRBG_reseed.3.gz
Only in /usr/share/openssl/man/man3: RAND_DRBG_secure_new.3.gz
Only in /usr/share/openssl/man/man3: RAND_DRBG_set.3.gz
Only in /usr/share/openssl/man/man3: RAND_DRBG_set_callbacks.3.gz
Only in /usr/share/openssl/man/man3: RAND_DRBG_set_defaults.3.gz
Only in /usr/share/openssl/man/man3: RAND_DRBG_set_ex_data.3.gz
Only in /usr/share/openssl/man/man3: RAND_DRBG_set_reseed_defaults.3.gz
Only in /usr/share/openssl/man/man3: RAND_DRBG_set_reseed_interval.3.gz
Only in /usr/share/openssl/man/man3: RAND_DRBG_set_reseed_time_interval.3.gz
Only in /usr/share/openssl/man/man3: RAND_DRBG_uninstantiate.3.gz
Only in /usr/share/openssl/man/man3: RSA_padding_add_SSLv23.3.gz
Only in /usr/share/openssl/man/man3: RSA_padding_check_SSLv23.3.gz
Only in /usr/share/openssl/man/man7: RAND_DRBG.7.gz
Only in /usr/share/openssl/man/man7: scrypt.7.gz
Only in /usr/tests/atf_python/sys/net: netlink.py
Only in /usr/tests/cddl/usr.sbin/dtrace/amd64: kinst
Only in /usr/tests/lib/libarchive: test_fuzz.cab.uu
Only in /usr/tests/lib/libarchive: test_fuzz.lzh.uu
Only in /usr/tests/lib/libarchive: test_fuzz_1.iso.Z.uu
Only in /usr/tests/lib/libbe: mnt
Only in /usr/tests/lib/libc/tls: libh_tls_dlopen_p.a
Only in /usr/tests/lib/libc/tls: libh_tls_dynamic_p.a
Only in /usr/tests/libexec/rtld-elf: libpythagoras_p.a
Only in /usr/tests/sys/netpfil/pf: checksum
Only in /usr/tests/sys/netpfil/pf: fragmentation
Only in /usr/tests/sys/netpfil/pf: rdr
Only in /usr/tests/sys/netpfil/pf: scrub
Only in /usr/tests/usr.bin/gh-bc: functions.sh
Only in /usr/tests/usr.bin/gh-bc/tests: afl.py
Only in /usr/tests/usr.bin/gh-bc/tests: bc_outputs
Only in /usr/tests/usr.bin/gh-bc/tests/dc/errors: 34.txt
Only in /usr/tests/usr.bin/gh-bc/tests: dc_outputs
Only in /usr/tests/usr.bin/gh-bc/tests: diff.sh
Only in /usr/tests/usr.bin/gh-bc/tests: radamsa.sh
Only in /usr/tests/usr.bin/gh-bc/tests: radamsa.txt
Only in /usr/tests/usr.bin/gh-bc/tests: randmath.py
Only in /usr/tests/usr.bin: timeout
Only in /usr/tests/usr.sbin/mixer: Kyuafile
Only in /usr/tests/usr.sbin/mixer: mixer_test


===
Mark Millard
marklmi at yahoo.com