# Apache and libexpat.so.0, error after an update

## JC99

Greetings,

I just upgraded some programs as I do every Sunday (I didn't update apache as there was no update available), but now when I try to start apache I get the following error...

```
Apache2 has detected a syntax error in your configuration files:

/usr/sbin/apache2: error while loading shared libraries: libexpat.so.0: cannot open shared object file: No such file or directory

```

I tried...

```
revdep-rebuild -X
```

but that didn't fix the problem. I have libexpat.so.1 when apache wants libexpat.so.0. Anyone know how I can fix this?Last edited by JC99 on Mon Aug 13, 2007 3:07 am; edited 1 time in total

----------

## JC99

I solved the problem by doing the following...

```
cd /usr/lib

ln -sf libexpat.so.1 libexpat.so.0
```

This is probably incorrect, but hey... it works!

If anyone knows a better way to solve this problem mentioned above please let me know here in the forums.

----------

## roderick

Never symlink library files this way.

Re-emerge apache or run revdep-rebuild or revdep-rebuild --library libexpat.so.0 if revdep-rebuild does not work.

Did you have --as-needed in you LDFLAGS? It's possible that the apache build actually does need expat but the build system (ld) thought it did not because of the as-needed....

Anyway, try my suggestions.

If you leave the symlink, then you risk random crashes, and untrackable bugs in the future. The ABI for expat changed and you do need to rebuild against the correct new API.

----------

## JC99

 *roderick wrote:*   

> Never symlink library files this way.
> 
> Re-emerge apache or run revdep-rebuild or revdep-rebuild --library libexpat.so.0 if revdep-rebuild does not work.
> 
> 

 

Didn't work

----------

## kharan5876

I had to upgrade apache to ~x86 because no matter how I recompiled the stable version, /usr/sbin/apache2 would continue to look for expat.so.0.

the newer apache also uses the newer apr-utils. The old apr-utils used by the stable apache also does not appear to support the newer expat because after recompiling it, it would also still try to link to expat.so.0. revdep-rebuild would try to reemerge it every time.

I would recommend using unstable or masking the new expat. That symlink is going to cause all kinds of problems.

----------

## fallen

I used to do the same thing, like, if i had lib troubles i'd just cp or ln -s them, but then everything started going haywire.

now i revdep-rebuild and re-emerge everything  :Razz: 

----------

## p0llux

I got the same problem after running revdep-rebuild but re-emerging the old version of apr-util (0.9.12-r1) solved it.

----------

## roderick

apr-utils was slotted. revdep-rebuild never tried to properly re-emerge the old one. 

So, some solutions: if nothing actually still explicitly requires the old one, emerge -C it. If you think something may explicitly require it, then emerge -1 =dev-libs/apr-util-0.9*

This should fix that issue. Slotted packages and dep checks are difficult. If you have any slotted packages, beware. These issues can crop up.

----------

## Ateo

 *roderick wrote:*   

> So, some solutions: if nothing actually still explicitly requires the old one, emerge -C it. If you think something may explicitly require it, then emerge -1 =dev-libs/apr-util-0.9*

 

Thank you. This worked.

Why is this a recurring issue I wonder.

----------

## herrzattacke

Yeah remerging apr-util worked, thx.

You can add a [solved] to topic.

----------

## justincataldo

Gah! I can't figure this out! I re-emerged apr-util but it didn't work. What am I missing?

```

aria ~ # revdep-rebuild

Configuring search environment for revdep-rebuild

Checking reverse dependencies...

Packages containing binaries and libraries broken by a package update

will be emerged.

Collecting system binaries and libraries... done.

  (/root/.revdep-rebuild.1_files)

Collecting complete LD_LIBRARY_PATH... done.

  (/root/.revdep-rebuild.2_ldpath)

Checking dynamic linking consistency...

  broken /usr/bin/svn (requires  libexpat.so.0)

  broken /usr/bin/svnadmin (requires  libexpat.so.0)

  broken /usr/bin/svndumpfilter (requires  libexpat.so.0)

  broken /usr/bin/svnlook (requires  libexpat.so.0)

  broken /usr/bin/svnserve (requires  libexpat.so.0)

  broken /usr/bin/svnsync (requires  libexpat.so.0)

  broken /usr/bin/svnversion (requires  libexpat.so.0)

  broken /usr/lib/libaprutil-0.so.0.9.12 (requires  libexpat.so.0)

  broken /usr/lib/libsvn_client-1.so.0.0.0 (requires  libexpat.so.0)

  broken /usr/lib/libsvn_delta-1.so.0.0.0 (requires  libexpat.so.0)

  broken /usr/lib/libsvn_diff-1.so.0.0.0 (requires  libexpat.so.0)

  broken /usr/lib/libsvn_fs_base-1.so.0.0.0 (requires  libexpat.so.0)

  broken /usr/lib/libsvn_fs_fs-1.so.0.0.0 (requires  libexpat.so.0)

  broken /usr/lib/libsvn_ra-1.so.0.0.0 (requires  libexpat.so.0)

  broken /usr/lib/libsvn_ra_dav-1.so.0.0.0 (requires  libexpat.so.0)

  broken /usr/lib/libsvn_ra_local-1.so.0.0.0 (requires  libexpat.so.0)

  broken /usr/lib/libsvn_ra_svn-1.so.0.0.0 (requires  libexpat.so.0)

  broken /usr/lib/libsvn_repos-1.so.0.0.0 (requires  libexpat.so.0)

  broken /usr/lib/libsvn_subr-1.so.0.0.0 (requires  libexpat.so.0)

  broken /usr/lib/libsvn_swig_perl-1.so.0.0.0 (requires  libexpat.so.0)

  broken /usr/lib/libsvn_swig_py-1.so.0.0.0 (requires  libexpat.so.0)

  broken /usr/lib/libsvn_wc-1.so.0.0.0 (requires  libexpat.so.0)

 done.

  (/root/.revdep-rebuild.3_rebuild)

Assigning files to ebuilds... done.

  (/root/.revdep-rebuild.4_ebuilds)

Evaluating package order...

Warning: Failed to resolve package order.

Will merge in "random" order!

Possible reasons:

- An ebuild is no longer in the portage tree.

- An ebuild is masked, use /etc/portage/packages.keyword

  and/or /etc/portage/package.unmask to unmask it

..... done.

  (/root/.revdep-rebuild.5_order)

All prepared. Starting rebuild...

emerge --oneshot  =dev-libs/apr-util-0.9.12-r1 =dev-util/subversion-1.4.4-r2

..........

Calculating dependencies |

emerge: there are no ebuilds to satisfy "=dev-util/subversion-1.4.4-r2".

revdep-rebuild failed to emerge all packages

you have the following choices:

- if emerge failed during the build, fix the problems and re-run revdep-rebuild

    or

- use -X or --package-names as first argument (trys to rebuild package, not exact

  ebuild)

    or

- set ACCEPT_KEYWORDS="~<your platform>" and/or /etc/portage/package.unmask

  (and remove /root/.revdep-rebuild.5_order to be evaluated again)

    or

- modify the above emerge command and run it manually

    or

- compile or unmerge unsatisfied packages manually, remove temporary files and

  try again (you can edit package/ebuild list first)

To remove temporary files, please run:

rm /root/.revdep-rebuild*.?_*

aria ~ #

```

```

aria ~ # /etc/init.d/apache2 start

 * Apache2 has detected a syntax error in your configuration files:

/usr/sbin/apache2: error while loading shared libraries: libexpat.so.0: cannot open shared object file: No such file or directory

aria ~ #

```

----------

## justincataldo

Anybody?

----------

## tarpman

That version of dev-util/subversion doesn't exist in the tree any more.  Update it to dev-util/subversion-1.4.4-r3.

----------

## justincataldo

Not quite. I still can't get it to start.  :Sad: 

```
aria ~ # /etc/init.d/apache2 start

 * Starting apache2 ...

(98)Address already in use: make_sock: could not bind to address [::]:443

(98)Address already in use: make_sock: could not bind to address 0.0.0.0:443

no listening sockets available, shutting down

Unable to open logs                                                                                                                                    [ !! ]

aria ~ #

```

----------

## HRH_H_Crab

 *Quote:*   

> Gah! I can't figure this out! I re-emerged apr-util but it didn't work. What am I missing? 

 

Im not sure, but you may have 2 versions of apr-util installed (slotted). 

Revdep-rebuild (and straight emerge apr-util) will only build the newest one.

I had to do the first one two... I think "equery -l apr-util" will show you the versions, its posted in another thread.

Even though this seems to have got me past the expat errors, I am now getting mod-access errors though...

----------

## justincataldo

I don't have that equery package?

```

aria ~ # equery

!!! No command or unknown command given

Usage: equery <global-opts> command <local-opts>

where <global-opts> is one of

 -q, --quiet   - minimal output

 -C, --nocolor - turn off colours

 -h, --help    - this help screen

 -V, --version - display version info

 -N, --no-pipe - turn off pipe detection

where command(short) is one of

 belongs(b) <local-opts> files... - list all packages owning files...

 changes(c)  - not implemented yet

 check(k) pkgspec - check MD5sums and timestamps of pkgspec's files

 depends(d) <local-opts> pkgspec - list all direct dependencies matching pkgspec

 depgraph(g) <local-opts> pkgspec - display a dependency tree for pkgspec

 files(f) <local-opts> pkgspec - list files owned by pkgspec

 glsa(a)  - not implemented yet

 hasuse(h) <local-opts> useflag - list all packages with useflag

 list(l) <local-opts> pkgspec - list all packages matching pkgspec

 size(s) <local-opts> pkgspec - print size of files contained in package pkgspec

 stats(t)  - not implemented yet

 uses(u) <local-opts> pkgspec - display USE flags for pkgspec

 which(w) pkgspec - print full path to ebuild for package pkgspec

aria ~ # emerge equery -pv

These are the packages that would be merged, in order:

Calculating dependencies \

emerge: there are no ebuilds to satisfy "equery".

aria ~ # emerge --search equery

Searching...

[ Results for search key : equery ]

[ Applications found : 0 ]

aria ~ #

```

----------

## tobimat80

 *justincataldo wrote:*   

> I don't have that equery package?
> 
> ```
> 
> aria ~ # equery
> ...

 

Try 'equery list apr-util'

----------

## gohmdoree

i tried out the above suggested also

```

ln -sf libexpat.so.1 libexpat.so.0

```

in /usr/lib.

afterwards, i was able to emerge attr (this was the 2007.0 profile), then removed the symlink after running revdep

----------

