# Pointing programs to newer dependency



## Grell (Oct 12, 2012)

Hello all, it has been a little while since I used FreeBSD and I have installed and started using it again.  I have a question, say I install a program, then later one of its dependencies gets update and that old program still points to an older (non-existent) library.  I want to be able to get the old program to point to the new library.  I also want to do this without using pkgdb and portupgrade and such.  I want to use portmaster and other programs that don't have external databases.  How can I do this?  Thanks.


----------



## wblock@ (Oct 12, 2012)

See Upgrading FreeBSD Ports.


----------



## jb_fvwm2 (Oct 12, 2012)

```
cp -iv /usr/local/lib/libpng.so.6 /usr/local/lib/compat/libpng.so.5
# sometimes works, one can continue using the system normally if the new dependency has many ports depending upon it
```
More an answer to the question, though...
For many ports, a simple portmaster usage...  here an
actual example

```
# sometimes quicker (-PP -i )
portmaster -d -B -P -i -g --update-if-newer www/midori www/epiphany && yell || yell
```
I use yell because sometimes the build(s) halt on wrong fetch parameters in make.conf or the port will build only singly from within its subdirectory or it will build not with clang or the other usual stuff...


----------



## wblock@ (Oct 12, 2012)

No, please don't copy or symlink new libraries as an old version.  Rebuild the programs that depend on that old library, or risk mysterious problems later: http://forums.freebsd.org/showthread.php?t=32311.


----------



## jb_fvwm2 (Oct 13, 2012)

I wholeheartedly agree "not symlinking," if even just for the complexity of undoing it later.  The /compat/ method has never caused any problem here, though, even with the warnings interspersed in later port builds, that libraries being used during the build link to older .so. files.  Indeed, those latter warnings may serve as a convenient reminder to remove the /compat/ file later.  (Although in a few cases, the /compat/ method would be unwise. I'd rather have the use of the system in the meantime (during the hundreds of builds or upgrades) than worry about it not being wise, having never noticeably had problems. OTOH some
complex breakage (qt4  on a few machines) may be a result, my desktop usage (for which I state this case) never has been impacted adversely.
  Each use of /compat/ should be considered unique though, so it is not
a blanket recommendation, YMMV, etc.
  I should probably mention that I copy the file manually rather than using a switch on the portmaster/portupgrade command line; that way one has to usually read the pkg-plist to check if it is not wise due to the number (greater than one or two ) of .so.  files. (So another reason for it not to be a 
blanket recommendation.)


----------

