alex lupu wrote: > QUESTION > > Is there a > - safe > - efficient > way to clean up '/usr/lib'? > > Low priority. If somebody has a good idea and has nothing better to do ... > > DETAILS > > As a somewhat extreme example, my library has ended up with stuff of this > kind: > > []% ls -ogtr libgdk-x11-2.0.so* | cut -c13- > > 1453058 2005-10-09 12:44 libgdk-x11-2.0.so.0.600.7 > 1483071 2007-03-01 22:53 libgdk-x11-2.0.so.0.800.20 > 1813487 2008-06-24 23:07 libgdk-x11-2.0.so.0.1200.10 > 1887699 2009-06-27 11:20 libgdk-x11-2.0.so.0.1400.7 > 2155925 2010-06-27 20:49 libgdk-x11-2.0.so.0.2100.0 > 2184669 2010-06-27 21:19 libgdk-x11-2.0.so.0.2102.0 > 2148459 2011-03-04 00:51 libgdk-x11-2.0.so.0.2400.0 > 2148463 2011-03-09 19:21 libgdk-x11-2.0.so.0.2400.1 > 2148403 2011-03-28 17:56 libgdk-x11-2.0.so.0.2400.3 > 2148527 2011-07-14 20:15 libgdk-x11-2.0.so.0.2400.5 > 2486893 2012-01-09 14:12 libgdk-x11-2.0.so.0.2400.8 > 2487926 2012-03-19 22:57 libgdk-x11-2.0.so.0.2400.10 > 2764338 2012-12-01 17:50 libgdk-x11-2.0.so.0.2400.13 > 2765279 2013-04-29 13:30 libgdk-x11-2.0.so.0.2400.17 > 2768025 2013-10-04 12:59 libgdk-x11-2.0.so.0.2400.21 > 27 2013-10-04 12:59 libgdk-x11-2.0.so.0 -> libgdk-x11-2.0.so.0.2400.21 > 27 2013-10-04 12:59 libgdk-x11-2.0.so -> libgdk-x11-2.0.so.0.2400.21 > > Not pretty. Apparently, a sizable dead space waiting to be reclaimed.
Actually, the files needed are the .so and .so.0 links and, of course, the file they point to. The .so file is what the linker looks for and the loader looks for the .so.0 file. You can delete the rest. I have: lrwxrwxrwx /usr/lib/libgdk-x11-2.0.so -> libgdk-x11-2.0.so.0.2400.20 lrwxrwxrwx /usr/lib/libgdk-x11-2.0.so.0 -> libgdk-x11-2.0.so.0.2400.20 -rwxr-xr-x 3262680 Aug 18 16:04 /usr/lib/libgdk-x11-2.0.so.0.2400.20 You can also save a lot of space by stripping. My file slimmed down to 721232, or to about 25% of the unstripped version. > ------ > > Now for a practical example of an ill-advised clean-up attempt. > Say, I see something like > > []% ls -ogtr libjpeg.so* | cut -c13- > > 137053 2005-10-01 13:12 libjpeg.so.62.0.0 > 17 2009-06-25 19:09 libjpeg.so.62 -> libjpeg.so.62.0.0 > 772984 2010-01-01 15:52 libjpeg.so.7.0.0 > 16 2010-01-01 15:52 libjpeg.so.7 -> libjpeg.so.7.0.0 > 921939 2012-03-27 12:51 libjpeg.so.8.4.0 > 425541 2013-09-30 12:05 libjpeg.so.8.0.2 > 16 2013-09-30 12:05 libjpeg.so.8 -> libjpeg.so.8.4.0 > 16 2013-09-30 12:05 libjpeg.so -> libjpeg.so.8.0.2 That's an example where you have three versions of the library, all of which may be in use. You have to find all the programs that need a library and rebuild them. Note that only libjpeg.so -> libjpeg.so.8.0.2 is used for new builds and libjpeg.so.8 points to libjpeg.so.8.4.0. I think there is a potential problem there. -- Bruce -- http://linuxfromscratch.org/mailman/listinfo/blfs-support FAQ: http://www.linuxfromscratch.org/blfs/faq.html Unsubscribe: See the above information page
