# Check base system for obsolete or orphaned files



## Arkane (Sep 11, 2020)

After several freebsd-updates I ran today in an issue with /lib/libreadline conflicting with /usr/local/lib/libreadline. The former (/lib/libreadline) seems to be a left over from a previous FreeBSD version.
After removing the old one in /lib and running ldconfig the bash shell started to work again. 
Is there some tooling which checks the base system and reports these kind of 'left overs'? I've noticed there a still some old binaries still in the base from previous releases.
I tried 'freebsd-update IDS' but it did not report those files.


----------



## SirDice (Oct 2, 2020)

Arkane said:


> Is there some tooling which checks the base system and reports these kind of 'left overs'?


If you have the source tree installed (/usr/src/) you can run `make delete-old` and `make delete-old-libs`. You may want to set BATCH_DELETE_OLD_FILES or it's going to ask if you want to remove each and every file (which can be a lot). 



Arkane said:


> I've noticed there a still some old binaries still in the base from previous releases.


When you do a major version upgrade you need to run freebsd-update(8) _three_ times. The first install run only updates the kernel, the second install installs the userland and that third time removes the old libraries and executables.


----------



## olli@ (Oct 2, 2020)

SirDice said:


> You may want to set BATCH_DELETE_OLD_FILES or it's going to ask if you want to remove each and every file (which can be a lot).


Alternatively you may use yes(1), like in `yes | make delete-old`. Less typing.


----------

