Safe to delete old files in /usr/lib?

Markus Edemalm markus at edemalm.se
Mon Jan 4 18:18:06 UTC 2016


> 4 jan. 2016 kl. 18:52 skrev Polytropon <freebsd at edvax.de>:
> 
> On Mon, 4 Jan 2016 18:28:14 +0100, Markus Edemalm wrote:
>>> 4 jan. 2016 kl. 18:12 skrev Polytropon <freebsd at edvax.de>:
>>> 
>>> On Mon, 4 Jan 2016 18:06:00 +0100, Markus Edemalm wrote:
>>>> Hello,
>>>> 
>>>> My system was first installed as 10.0-RELEASE. I have since upgraded to 10.1, 10.1-STABLE, 10.2-RELEASE and is now at 10.2-RELEASE-p8.
>>>> I’ve rebuild from source and followed the steps in the handbook. Everything is fine… but:
>>>> 
>>>> I see many files in /usr/lib with old dates, apparently they are no longer installed during upgrades.
>>>> 
>>>> My /etc/make.conf looks like this:
>>>> 
>>>> NO_PROFILE=true
>>>> WITHOUT_X11=yes
>>>> 
>>>> Today, January the 4th, I upgraded to -p8. The newly installed files has todays date, i.e ”Jan  4”.
>>>> If I do:
>>>> 
>>>> ls -lF /usr/lib | grep -v 'Jan  4' | awk {'print $9'}
>>>> 
>>>> …I get the following list of (obsolete?) files and folders with older dates.
>>>> 
>>>> aout/
>>>> compat/
>>>> libBlocksRuntime.a
>>>> libalias.a
>>>> libalias_cuseeme.a
>> 
>> [long list cut]
>> 
>>>> liby.a
>>>> libypclnt.a
>>>> libz.a
>>>> libzfs.a
>>>> libzfs_core.a
>>>> libzpool.a
>>>> 
>>>> Would it be safe to delete them?
>>> 
>>> If you install from source, use the following targets:
>>> 
>>> # check-old           - List obsolete directories/files/libraries.
>>> # check-old-dirs      - List obsolete directories.
>>> # check-old-files     - List obsolete files.
>>> # check-old-libs      - List obsolete libraries.
>> 
>> Sorry, no files in /usr/lib comes up. Just a few others I know about.
>> 
>>> And then:
>>> 
>>> # delete-old          - Delete obsolete directories/files/libraries.
>>> # delete-old-dirs     - Delete obsolete directories.
>>> # delete-old-files    - Delete obsolete files.
>>> # delete-old-libs     - Delete obsolete libraries.
>>> 
>>> See the comment header of /usr/src/Makefile for more information
>>> (and how those targets fit the recommended updating procedure,
>>> listed a few lines later).
>>> 
>>> Generally speaking: As long as no program is linked against those
>>> files, and no program requires them, they can be deleted. This
>>> statement highly depends on which programs you have installed
>>> and what they are linked against. :-)
>> 
>> Thank you. Still wonder why they are so many and where the came from in the first place.
> 
> They have been installed by the OS (from the initial installation
> media or subsequent update processes), as the /usr/lib directory
> is reserved for OS files (like /usr/local/lib is for 3rd party
> libraries).
> 
> 
> 
>> And, they are all .a files, except for libc++.so and libc.so.
>> 
>> I added NO_PROFILE=true to /etc/make.conf a while back. Is that relevant?
> 
> Hmmm... I always thought that would be the default (no profiling libs
> being built and installed). But according to "man src.conf", the
> setting's name is WITHOUT_PROFILE, not NO_PROFILE.

Hmm. I forgot about src.conf, I got:

cat /etc/src.conf 
WITHOUT_BLUETOOTH=yes
WITHOUT_FLOPPY=yes
WITHOUT_IPFW=yes
WITHOUT_IPFILTER=yes

That may explain why _some_ libs are not being built and installed.
But still, more than 100 .a files with old dates. Doesn’t make sense to me at all.

/ME



More information about the freebsd-questions mailing list