# Shared object "libxcb.so.2" not found



## xavi (Jul 10, 2014)

Hi,

My version of FreeBSD 9.2 stopped running X and gnome2 recently. Instead of displaying the login dialog it now displays a command-line login prompt. And when I type `startx` I get the following error:


```
Shared object "libxcb.so.2" not found, required by "libXmuu.so.1"
```

Searching for this string on the internet led me to an entry in /usr/ports/UPDATING (for 20140416) which states to use either of the following commands to fix the issue:

`portmaster -r freetype2 -r libxml2 -r pixman -r freeglut -r libxcb` or `portupgrade -rf freetype2 libxml2 pixman freeglut libxcb`

However, running the first command gives an error of: 


```
'The argument to -r must match only one port'
```

And running the second gives an error of:


```
origins - not a string (NilClass): Cannot read the pkgdb!
Command failed [exit code 1]: /usr/local/sbin/pkgdb -aFOQ
```

I've tried to follow the advice given of building sysutils/bsdadminscripts and running `pkg_libchk` to see which libraries need rebuilding but this gives an error of:


```
Shared object "libarchive.so.5" not found, required by "pkg"
```

I upgraded to 10.0-RELEASE using freebsd-update(8) in the hope that this would fix it, but it hasn't. I've also read the thread '[Solved] libxcb.so.2 missing' at https://forums.freebsd.org/viewtopic.php?f=5&t=46256 a number of times, but being a relative newbie with FreeBSD I still don't understand what the solution is.

So, can  someone explain in layman's terms please:

What's happened to break things?
Why it's happened?
What I can do to fix it? 
How to prevent it happening in the future?
Many thanks in advance.


----------



## SirDice (Jul 10, 2014)

xavi said:
			
		

> What's happened to break things?


A dependency changed its version number and whatever depended on it wasn't rebuilt to link against the new version.



> Why it's happened?


Not following /usr/ports/UPDATING



> What I can do to fix it?


A `portmaster -r libxcb` should probably fix it.



> How to prevent it happening in the future?


Reading /usr/ports/UPDATING before updating. Sometimes things need to be updated in a specific order.


----------



## wblock@ (Jul 10, 2014)

`pkg_libchk -qo` will show the ports that need to be rebuilt, and can even be fed straight into portmaster(8): `portmaster `pkg_libchk -qo``.

For a quick "best practices" document on maintaining ports, please see Upgrading FreeBSD Ports.


----------

