NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: How to remove old libraries ?



BERTRAND Joël <joel.bertrand%systella.fr@localhost> writes:

> 	My server runs NetBSD for a very long time (if I remember, first
> installation was done with NetBSD 4.0). Motherborad was changed, raid1/5
> volumes also... But installation was done a long time ago and upgraded
> from sources.

Many others have the same sorts of feelings.

  > ls -ltr /usr/lib/libstdc*
  -r--r--r--  1 root  wheel   342941 Jul 13  2003 /usr/lib/libstdc++.so.4.0
  lrwxr-xr-x  1 root  wheel       16 Jul 13  2003 /usr/lib/libstdc++.so.4 -> libstdc++.so.4.0
  -r--r--r--  1 root  wheel   915503 May  7  2006 /usr/lib/libstdc++.so.5.0
  lrwxr-xr-x  1 root  wheel       16 May  7  2006 /usr/lib/libstdc++.so.5 -> libstdc++.so.5.0
  -r--r--r--  1 root  wheel  1118243 Nov 17  2014 /usr/lib/libstdc++.so.6.0
  lrwxr-xr-x  1 root  wheel       16 Nov 17  2014 /usr/lib/libstdc++.so.6 -> libstdc++.so.6.0
  -r--r--r--  1 root  wheel  1312289 Oct 27  2018 /usr/lib/libstdc++.so.7.3
  lrwxr-xr-x  1 root  wheel       16 Oct 27  2018 /usr/lib/libstdc++.so.7 -> libstdc++.so.7.3
  -r--r--r--  1 root  wheel  1458944 Apr 18  2020 /usr/lib/libstdc++.so.8.0
  lrwxr-xr-x  1 root  wheel       16 Jan  2  2022 /usr/lib/libstdc++.so.8 -> libstdc++.so.8.0
  -r--r--r--  1 root  wheel  5774150 Mar 31 18:19 /usr/lib/libstdc++_p.a
  -r--r--r--  1 root  wheel  5459714 Mar 31 18:19 /usr/lib/libstdc++.a
  -r--r--r--  1 root  wheel  2417272 Mar 31 18:19 /usr/lib/libstdc++.so.9.0
  lrwxr-xr-x  1 root  wheel       16 Mar 31 18:19 /usr/lib/libstdc++.so.9 -> libstdc++.so.9.0
  lrwxr-xr-x  1 root  wheel       16 Mar 31 18:19 /usr/lib/libstdc++.so -> libstdc++.so.9.0

> 	Now, I have some trouble to build Libreoffice. I have found that this
> bug comes from old libraries (libstdc++7). Effectively, /lib and
> /usr/lib contain a lot of old shared libraries. How can I purge these
> directories without doing a mistake ?

The basic answer is "carefully".

But I would suggest that after you have done an install/upgrade
recently, you can do something like

  cd /usr/lib
  find . -name \*.so\* -mtime +365 > /tmp/OLD
  more /tmp/OLD
  cat /tmp/OLD | xargs ls -ltr | more
  # think, and make sure you aren't deleting libc, and that rescue is ok
  # and that you could recover your system
  tar cfvz ~/usr-lib-prune.tgz `cat /tmp/OLD`
  cat /tmp/OLD | xargs rm

because the important thing is to be able to recover without too much
pain if you do make a mistake.

Then you can look at /lib and you can be more aggresssive.

Note that this will break compat of old binaries.  But that may be ok.




Home | Main Index | Thread Index | Old Index