ImportError: libffi.so.6: cannot open shared object file: No such file or directory

Hello there,

I am trying to use vscode-postgresql extension which demands libffi.so.6 installed.

Whenever I try to establish a connection, I get the following error:


Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/cx_Freeze/initscripts/__startup__.py", line 14, in run
  File "/usr/local/lib/python3.6/dist-packages/cx_Freeze/initscripts/Console.py", line 26, in run
  File "pgsqltoolsservice/pgtoolsservice_main.py", line 11, in <module>
  File "/usr/local/lib/python3.6/dist-packages/ptvsd/__init__.py", line 17, in <module>
  File "/usr/local/lib/python3.6/dist-packages/ptvsd/attach_server.py", line 35, in <module>
  File "/usr/local/lib/python3.6/dist-packages/ptvsd/visualstudio_py_debugger.py", line 24, in <module>
  File "/usr/lib/python3.6/ctypes/__init__.py", line 7, in <module>
ImportError: libffi.so.6: cannot open shared object file: No such file or directory
[Error - 20:01:51] Connection to server got closed. Server will not be restarted.

It seems a known issue* and one the possible workaround is to install libffi6.

*https://github.com/microsoft/vscode-postgresql/issues/77

I’ve tried to install *rpm * files from https://pkgs.org/download/libffi6 but got weird errors.

FIles:




Curiously, I have libffi8 installed:


sudozypper se -i libffi              
                                                                                         

S  | Name    | Summary                            | Type
---+---------+------------------------------------+--------
i+ | libffi8 | Foreign Function Interface Library | package


But it didn’t helps.

Steps to reproduce:

  1. Install ext
  2. Ctrl + Shift + P
  3. PostgreSQL: New Query

Any thoughts? Many thanks.

Hi
Installing random rpms is a recipe for disaster… are you even on aarch64?

Ask whoever builds the plugin to update for libffi8? Else install the version from server:monitoring repository, YMMV.

https://software.opensuse.org/package/libffi6
https://build.opensuse.org/package/show/server:monitoring/libffi
https://download.opensuse.org/repositories/server:/monitoring/openSUSE_Tumbleweed/

Thanks for the feedback about rpm. I can testify you are 100% right.

are you even on aarch64?

I am not. :expressionless:


arch

x86_64

Regarding server:monitoring repository, I was not even aware of it. Honestly I was used to get packages from any open suse repo out there (mostly LEAP 15) [possibly a big mistake as well].

Anyhow I download the right package libffi6-32bit-3.2.1-1.15.x86_64.rpm from https://download.opensuse.org/repositories/server:/monitoring/openSUSE_Tumbleweed/x86_64/

Installed it:


sudo rpm -i libffi6-32bit-3.2.1-1.15.x86_64.rpm


and that works flawlessly for me!


sudo zypper se -i libffi                                                                                                                                           
Loading repository data...
Reading installed packages...

S  | Name    | Summary                            | Type
---+---------+------------------------------------+--------
i+ | libffi6 | Shared library for libffi          | package
i+ | libffi8 | Foreign Function Interface Library | package


Many many thanks!

Also, regarding being a newbie and use a rolling release distro that is because it was the only Linux distro that worked fine on my notebook HP ENVY x360.

How dangerous that sounds to you? Should I changes OS ASAP?

Hi
Tumbleweed is fine :slight_smile: Just take small steps, if not sure just start a new thread. You can use zypper to install rpms as well, suggest you start learning up on that. Don’t forget to use zypper dup when a new snapshot is released… and most important of all enjoy :slight_smile:

Thank you, Malcolm. Have a great day! :wink: