# emacs port - Shared object "libpng.so.5" not found



## rblon (May 5, 2010)

I have updated php5(-extensions) and for some reason emacs wasn't working afterwards (I got a message that libpng.so.5 couldn't be found).

As I didn't have many clues, I opted for reinstalling. So I went to /usr/ports/editors/emacs22 and did: `make deinstall & make reinstall`

But reinstalling isn't working as I get the following error:


```
/libexec/ld-elf.so.1: Shared object "libpng.so.5" not found, required by "libgtk-x11-2.0.so.0"
```
Does anyone have tips what to do/try?

PS I am running FreeBSD 7.2


----------



## DutchDaemon (May 5, 2010)

Did you apply the /usr/ports/UPDATING section on PHP?


----------



## rblon (May 5, 2010)

ok - got it sorted now

"make build-depends-list" was my friend

Based on that and the error message I decided to reinstall x11-toolkits/gtk20

However, to get that work, I also had to reinstall

devel/glib20
graphics/tiff
graphics/png
graphics/jasper
x11-toolkits/pango

So my method was:

make deinstall & make reinstall

if reinstalling gives an error, I look which package needs reinstalling and go there, etc.

So quite cumbersome... it seems i'm doing something wrong... any tips on what I should do better?


----------



## rblon (May 5, 2010)

DutchDaemon said:
			
		

> Did you apply the /usr/ports/UPDATING section on PHP?



Nope... read it now and see that I should have deleted a couple of packages.

After making this mistake, is the way I sorted it right? Or could it have been done easier?


----------



## DutchDaemon (May 5, 2010)

I suggest you still apply the UPDATING advice. It's easy to miss one of those dependencies, which means you'll run into a different problem with one of the other ports later (when it may not be so obvious anymore).


----------



## rblon (May 5, 2010)

thanks I will do that.

Also is [cmd=]make deinstall & make reinstall[/cmd] the correct way of upgrading? In another thread (which I can't find anymore) it was advised to do [cmd=]pkg_delete[/cmd], but I don't know what the difference is.


----------



## rblon (May 5, 2010)

sorry, I tried to do the formatting, but obviously incorrect (and I can't edit; I should have used preview)


----------



## DutchDaemon (May 5, 2010)

For upgrading ports, tools like ports-mgmt/portmaster or ports-mgmt/portupgrade are far superior. No need to deinstall/reinstall ports, these tools do it for you, and keep track of dependencies. For the record: [cmd=]make deinstall[/cmd] should only be used to deinstall the exact same version as is now in the ports tree. When these versions differ, use [cmd=]pkg_delete[/cmd] which works from the file list that was valid when the port was installed (as opposed to what the file list is _now_, in the newer version). Basically: simply use pkg_delete


----------



## redchard (May 9, 2010)

Thanks for the helpful thread/post.

I have a couple of (probably) simple questions with regard to using

`pkg_delete`

versus

`make deinstall`

"pkg_delete" often complains that a pkg cannot be deleted b/c of dependencies, while "make deinstall" will point out the dependency issues "but I'll do it anyway".

Does your post mean that it is still better to do 

`pkg_delete -f` 

when that is the case?

Does it make a difference if a pkg is listed in /var/db/ports versus /var/db/pkg with regard to using one or the other of the above commands to remove it?


----------



## DutchDaemon (May 9, 2010)

Basically, [cmd=]make deinstall[/cmd] executes [cmd=]pkg_delete -f[/cmd]. 

Don't confuse /var/db/pkg with /var/db/ports. They serve entirely different purposes. All ports and packages have an entry in /var/db/pkg, simply because ports and packages are equivalents; the only difference lies in _how_ the software is installed; the end result (the installation) is the same. The /var/db/ports directory only contains the _options_ that were chosen for a port during [cmd=]make config[/cmd] (if any), and a pointer to a port's distfiles (in the case of portmaster anyway). 

Therefore, every package and every port has an entry in /var/db/pkg, whereas only ports with 'user-tuneable options' have an entry under /var/db/ports, and in the case of portmaster, all ports have a distfile entry. You will find that that directory contains only one or two types of file for every entry: files named options and distfiles (again: in the case of portmaster anyway).


----------

