# Can I delete unreferenced libraries files with no issue?



## piggy (Mar 30, 2011)

My system works absolutely fine. I do have no problems at all even if my system configuration is pretty much complex. We have to say this is an original FreeBSD 7 box upgraded over the years to 8.2. Everything was always upgraded using ports. Any program installed was built from scratch using the ports system.

Then, if I run *libcheck* program it complain about a great amount of unreferenced libraries. What happens if I simply delete those unreferenced libraries? I know I could do a backup and try it myself but I prefer to ask, for now.

Thanks in advance for any info.


----------



## mamalos (Mar 30, 2011)

I don't know how well *Libcheck* works (never used it), but if it works correctly (looks if all libraries used by "installed" programs (binaries and other libraries) are present) then you should have no fear removing them.


----------



## wblock@ (Mar 30, 2011)

piggy said:
			
		

> My system works absolutely fine. I do have no problems at all even if my system configuration is pretty much complexed.
> ...
> Everything was always upgraded using ports. Any program installed was build from scratch using ports system.
> 
> Then, if I run Libcheck program it complain about a very many lot of unreferenced libraries.



Which *libcheck* program?  Please show some of the complaints.

It also sounds like you're running without any backup, which is bad even if you aren't thinking about deleting libraries.


----------



## graudeejs (Mar 30, 2011)

Simply: No.... Save yourself (and us) troubles and Just don't try to do that

Otherwise I already see you posting:
This port doesn't work.... why?


----------



## SIFE (Mar 30, 2011)

I had tried this before and I ended by rebuilding my whole packages, I guessed to leave it because some day you will install a port will depend on old name library and you have to symlink between libraries.


----------



## Pushrod (Mar 30, 2011)

The smart thing to do when dealing with things like this is to _move_ them so that if they are in fact needed, you can save your system with mv instead of dealing with a much bigger headache.


----------



## ckester (Mar 30, 2011)

Also remember that if any running processes are using the library, deleting it won't have any immediately apparent effect on them.  You might not know you have a problem until those processes are stopped and restarted -- which might be quite some time later and only after a reboot.

So take Pushrod's advice and use mv rather than rm until you're absolutely sure the library isn't needed.

Or better yet, take killasmurf86's advice and leave well enough alone.


----------



## piggy (Mar 30, 2011)

mamalos said:
			
		

> I don't know how well *Libcheck* works (never used it), but if it works correctly (looks if all libraries used by "installed" programs (binaries and other libraries) are present) then you should have no fear removing them.


First of all, thanks for your interest.

```
libchk - checks shared library links of binaries
  version 1.10.1 [revision 24] (2009-08-05)
```
Which program do you advise me to try to check libraries used by installed programs?


----------



## piggy (Mar 30, 2011)

killasmurf86 said:
			
		

> Simply: No.... Save yourself (and us) troubles and Just don't try to do that
> 
> Otherwise I already see you posting:
> This port doesn't work.... why?


Absolutely not related with this libchk leftovers. In the recent times I just had problems with BerkeleyDB and was related with the massive Python2.6 to Python2.7 upgrade. Very, very rare in this days something goes wrong with my 3 BSD boxes and my PC-BSD box. I had like 150 days UP on this box, pretty much from security updates to 8.1 to 8.2. Everything was ALWAYS fixed with no reboots. I like uptime, like 15 years ago I managed to have a Windows NT 4 box with a 546 days uptime.

BTW guys, I do ALWAYS have backups, I do have a NAS Raid 1 dedicated to it, all my machines are backed up on that, even virtual ones (OS images once a week). Docs are backed up on five different medias in the same time. So I still do have pretty much everything starting from like 1985.


----------



## piggy (Mar 30, 2011)

Pushrod said:
			
		

> The smart thing to do when dealing with things like this is to _move_ them so that if they are in fact needed, you can save your system with mv instead of dealing with a much bigger headache.


Thanks for your hint.


----------



## wblock@ (Mar 30, 2011)

pkg_info(1) with the -W option will show which package installed a particular file.  It's a good test to make sure nothing is still expecting that file.  It works both ways, checking files that are missing libraries, and libraries that aren't being referenced.


----------



## dralex (Jul 18, 2011)

Is there something wrong with 
	
	



```
portsclean -L
```
 ??


----------

