Saturday, January 27, 2024

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

On Jan 27 17:46:07, ab@lists.gxis.de wrote:
> 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?

That's definitely weird. Which packages own these files?
$ pkg_info -E /usr/local/lib/libvpx.so.8.0
$ doas pkg_check -Fq

> 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?

pkg_add generally replaces the old version with the new 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

That's what pkg_info -F does.

No comments:

Post a Comment