Saturday, January 27, 2024

Re: cleaning up /usr/local/lib after (many) upgrades?

On 2024/01/27 17:46:07 +0100, Alexander Bochmann <ab@lists.gxis.de> wrote:
> Hi -
>
> I'm looking at one of my OpenBSD systems here that has been upgraded
> over a long time, and has /usr/local running out of space.
>
> It seems there's a lot of old versions of shared libraries in
> /usr/local/lib, like for example:
>
> > # ls -al /usr/local/lib/libvpx.so.*
> > -rw-r--r-- 1 root bin 1909442 Mar 27 2018 /usr/local/lib/libvpx.so.10.0
> > -rw-r--r-- 1 root bin 2047296 Oct 11 2018 /usr/local/lib/libvpx.so.11.0
> > -rw-r--r-- 1 root bin 3182104 Apr 19 2021 /usr/local/lib/libvpx.so.12.0
> > -rw-r--r-- 1 root bin 2049592 Sep 26 2021 /usr/local/lib/libvpx.so.13.0
> > -rw-r--r-- 1 root bin 2062112 Sep 29 2022 /usr/local/lib/libvpx.so.14.0
> > -rw-r--r-- 1 root bin 2057584 Mar 25 2023 /usr/local/lib/libvpx.so.15.0
> > -rw-r--r-- 1 root bin 2069504 Oct 6 00:20 /usr/local/lib/libvpx.so.16.0
> > -rw-r--r-- 1 root bin 1869707 Jul 26 2016 /usr/local/lib/libvpx.so.7.0
> > -rw-r--r-- 1 root bin 1909806 Oct 2 2017 /usr/local/lib/libvpx.so.8.0
>
> Is this expected, or a result of some error I made during upgrades?
> Usually I'm just running pkg_add -u to pull fresh versions of packages.
>
> And is there some "standard" way to get rid of the old versions?
> I could probably compare whatever is there against the pkglocate
> database or check each file against pkglocate individually and parse
> the output or something, but I'd assume I'm not the first user to
> run into this?

does pkg_delete -a help? It should remove all the packages not needed,
including the "special" .libs-<pkgname> packages that are often kept.

(but read the manpage, as "not needed" is a bit more broad than just
libs)

No comments:

Post a Comment