# Do I need multiple versions of Compat libraries?



## piggy (Jan 21, 2019)

I saw on a system updated from long time a lot of Compat library versions compiled from poirts?

Do I really need them of can I safely delete them with no conseguences like `pkg delete`seems to suggest?


----------



## SirDice (Jan 21, 2019)

If everything is updated correctly you can remove them.


----------



## olli@ (Jan 21, 2019)

You only need the compat libraries if you still have binaries that are linked against those libraries, i.e. they were compiled on those older releases. If you have updated or rebuilt _everything_, then you don't need the compat libraries anymore. For a quick check, you can use this command line (bourne shell syntax, doesn't work with csh):

```
ldd /usr/local/*bin/* 2>/dev/null | awk '/:$/ {B = $0} /compat/ {if (B) print B; B=""; print}'
```
If it doesn't print anything, then there are no binaries linked against compat libraries. Otherwise it lists those binaries and libraries.
*Note*, however, that the above command only checks binaries in /usr/local/bin and /usr/local/sbin. There might be binaries in other locations, too, for example in libexec or in users' home directories. If you want to be _really_ sure, you'll probably need to traverse the whole file system with find(1).


----------

