Wine can't find gnome-keyring-pkcs11.so

The solution to this needn't be any more complex than:

sudo apt-get install libp11-kit-gnome-keyring

for 64 bit machines. Or

sudo apt-get install libp11-kit-gnome-keyring:i386

for 32 bit machines.

At least this is the case in 13.04 and I see no reason why that wouldn't hold true in 12.04/12.10.


This solution works for Ubuntu 12.04 64bit

I originally had this error:

/usr/lib/i386-linux-gnu/pkcs11/gnome-keyring-pkcs11.so: /usr/lib/i386-linux-gnu/pkcs11/gnome-keyring-pkcs11.so: cannot open shared object file: No such file or directory

Then I did a ln -s link to the 64-bit lib and got this error: /usr/lib/i386-linux-gnu/pkcs11/gnome-keyring-pkcs11.so: wrong ELF class: ELFCLASS64

note: before you start remove the link to the 64bit lib if you created it.

Solution:

Here is how to fix it. Note I am using Crossover 11.3, which uses wine 1.4 so it should also work for wine users.

Further related information to getlibs can be found here.

1) Install getlibs:

UODATE 3/2013: Download getlibs from https://github.com/spaetzlecode/getlibs

wget https://raw.github.com/spaetzlecode/getlibs/master/getlibs
sudo chown root:root getlibs
sudo chmod +x getlibs
sudo mv -n getlibs /usr/local/bin

2) Install the 32bit library:

sudo /usr/local/bin/getlibs -p gnome-keyring:i386

If you got this message error:

Failed to download file http://mirrors.kernel.org/ubuntu/pool/main/g/gnome-keyring/gnome-keyring_3.4.1-4ubuntu1~precise1_i386.deb

then download the file right here:

wget https://launchpad.net/~gnome3-team/+archive/gnome3/+files/gnome-keyring_3.4.1-4ubuntu1~precise1_i386.deb

and do:

/usr/local/bin/getlibs -i "path-of-the-file"/gnome-keyring_3.4.1-4ubuntu1~precise1_i386.deb

3) Make the symbolic link:

sudo mkdir -p /usr/lib/i386-linux-gnu/pkcs11/ 
sudo ln -s /usr/lib32/i386-linux-gnu/pkcs11/gnome-keyring-pkcs11.so /usr/lib/i386-linux-gnu/pkcs11/gnome-keyring-pkcs11.so

Now run your Crossover/Wine app and the error is gone.


You probably guessed your needed to get the file /usr/lib/i386-linux-gnu/pkcs11/gnome-keyring-pkcs11.so. This file is part of an i386 ubuntu package which won't install directly on your amd64 system. But you can get it easily:

cd $(mktemp -d)                      ## create and go to a temporary temp dir
apt-get download gnome-keyring:i386  ## download the i386 version of gnome-keyring
ar x gnome-keyring*.deb              ## Uncompress the package
tar xf data.tar.gz
## Finally move the file you need to the desired location:
sudo mv usr/lib/i386-linux-gnu/pkcs11 /usr/lib/i386-linux-gnu/

This has happened to me on a 12.10 with wine-1.5.29, and i386 gnome-keyring version was labeled 3.6.1-0ubuntu1_i386, and this worked for me.

Please note that if these instruction do not fit for you, maybe should you mention your ubuntu release and gnome-keyring version. Thanks !