Page 1 of 1

Cannot find libffi.so.6

Posted: Tue Jan 08, 2019 7:32 pm
by ashort11
Hello,

I was installing SourecPython on a Counter-Strike:Source server (Ubuntu 18.04.01, Linux 4.15.0-1031-aws x86_64), and the server always gives this error when starting up:

Code: Select all

[Source.Python] Loading...
[Source.Python] Failed to load the main module due to following exception:
Traceback (most recent call last):

  File "/home/ubuntu/css/game/cstrike/addons/source-python/packages/source-python/__init__.py", line 98, in load
    setup_sqlite()

  File "/home/ubuntu/css/game/cstrike/addons/source-python/packages/source-python/__init__.py", line 447, in setup_sqlite
    import ctypes

  File "/home/ubuntu/css/game/cstrike/addons/source-python/Python3/ctypes/__init__.py", line 7, in <module>
    from _ctypes import Union, Structure, Array

ImportError: libffi.so.6: cannot open shared object file: No such file or directory
[Source.Python] Could not initialize python.
Failed to load plugin "addons/source-python"
[Source.Python] Unloading...
[Source.Python] Unloaded successfully.



I have libffi-dev installed, and when I type locate libffi.so.6, it finds it here:

Code: Select all

/usr/lib/x86_64-linux-gnu/libffi.so.6
/usr/lib/x86_64-linux-gnu/libffi.so.6.0.4


Is there somewhere in particular it is looking for the .so file? I have it symbolic linked so /lib/x86_64-linux-gnu as well, since that is where the libz.so.1 file is.

Apologies if this is in the wrong subforum.

Re: Cannot find libffi.so.6

Posted: Tue Jan 08, 2019 7:46 pm
by L'In20Cible

Re: Cannot find libffi.so.6

Posted: Tue Jan 08, 2019 7:50 pm
by ashort11
When I run the 32 bit distribution:

Code: Select all

ubuntu@ip-172-26-15-91:~$ sudo apt-get install libffi6
Reading package lists... Done
Building dependency tree
Reading state information... Done
libffi6 is already the newest version (3.2.1-8).
0 upgraded, 0 newly installed, 0 to remove and 86 not upgraded.
ubuntu@ip-172-26-15-91:~$ sudo apt-get install zlib1g
Reading package lists... Done
Building dependency tree
Reading state information... Done
zlib1g is already the newest version (1:1.2.11.dfsg-0ubuntu2).
0 upgraded, 0 newly installed, 0 to remove and 86 not upgraded.


When I run the 64 bit distrubution:

Code: Select all

ubuntu@ip-172-26-15-91:~$ sudo apt-get install zlib1g:i386
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package zlib1g:i386
ubuntu@ip-172-26-15-91:~$ sudo apt-get install libffi6:i386
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package libffi6:i386


EDIT:

I added i386 to dpkg, so I will update if this works.

For anyone in the future that might read this:

Code: Select all

sudo dpkg --add-architecture i386


EDIT (2):

This did fix the issue I was having.