libffi6 on ubuntu 20.04

All other Source.Python topics and issues.
decompile
Senior Member
Posts: 375
Joined: Sat Oct 10, 2015 10:37 am
Location: Germany
Contact:

libffi6 on ubuntu 20.04

Postby decompile » Tue Apr 28, 2020 3:33 am

Hello,

So I'm running Ubuntu 20.04 LTS, and on server start, I get following:

Code: Select all

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

[Source.Python] Could not initialize python.


Checking requirements in wiki, I found I have to execute following:

Code: Select all

sudo apt-get install zlib1g:i386   
sudo apt-get install libffi6:i386


but on libffi6 I get following:

sudo apt-get install libffi6:i386
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package libffi6:i386


tried:

Code: Select all

sudo apt-get install libffi-dev:i386


with success but didnt help.

Even did:

sudo dpkg --add-architecture i386
from this post here: viewtopic.php?p=12488#p12488
but it didnt help aswell.

I tried searching for libffi and got following:

sudo apt-cache search libffi
libffi-dev - Foreign Function Interface library (development files)
libffi7 - Foreign Function Interface library runtime
libalt-alien-ffi-system-perl - simplified alternative to Alien::FFI that uses system libffi
libffi-checklib-perl - module to check availability of a library for FFI
libffi-platypus-perl - module to create Perl bindings to non-Perl libraries with FFI
libffindex0 - library for simple index/database for huge amounts of small files
libffindex0-dev - library for simple index/database for huge amounts of small files (development)
libjffi-java - Java Foreign Function Interface
libjffi-jni - Java Foreign Function Interface (JNI library)


soooo yeah, I'm in need for help since I dont have much linux knowledge, to solve it myself.

Thanks
User avatar
Ayuto
Project Leader
Posts: 2107
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: libffi6 on ubuntu 20.04

Postby Ayuto » Thu Apr 30, 2020 7:49 pm

Looks like libffi6 isn't a supported package in Ubuntu 20.04. You could search for a way to install packages from older releases. Maybe it also works if you simply create a symlink from libffi7 to libffi6.
DeaD_EyE
Junior Member
Posts: 28
Joined: Wed Jan 08, 2014 10:32 am

Re: libffi6 on ubuntu 20.04

Postby DeaD_EyE » Sat May 02, 2020 6:29 pm

Prepare:

Code: Select all

# add 32 bit architecture
sudo dpkg --add-architecture i386

# install missing libraries
sudo apt-get install libstdc++6 lib32gcc1 libcurl4:i386 libffi7:i386



Method 1:
=========
# download libffi6:i386 from debian
https://packages.debian.org/buster/i386 ... 6/download
http://ftp.debian.org/debian/pool/main/ ... 9_i386.deb

Unpack the deb archive. I just used midnight commander for this task.
Copy the file `libffi.so.6.0.4` and the symlink `libffi.so.6` to your `bin` directory of csgo.

Then you can run source python.
The local fix has the benefit, that you don't affect your os.

Method 2:
=========

Code: Select all

sudo apt-get install libffi7:i386
cd your_gameserver/bin
ln -s /usr/lib/i386-linux-gnu/libffi.so.7 libffi.so.6


This won't also affect your os and it's better than downloading from somewhere a file.


Method 3:
=========

Code: Select all

sudo apt-get install libffi7:i386
cd /usr/lib/i386-linux-gnu/
sudo ln -s libffi.so.7 libffi.so.6
sudo ldconfig


You should not do this.
decompile
Senior Member
Posts: 375
Joined: Sat Oct 10, 2015 10:37 am
Location: Germany
Contact:

Re: libffi6 on ubuntu 20.04

Postby decompile » Mon May 11, 2020 8:55 pm

Method 2 worked, thank you!
User avatar
Doldol
Senior Member
Posts: 196
Joined: Sat Jul 07, 2012 7:09 pm
Location: Belgium

Re: libffi6 on ubuntu 20.04

Postby Doldol » Wed Nov 04, 2020 5:54 am

Just ran into this problem myself, I think the smoothest way is to just install libffi6 in addition, as to not get unintended side effects.

This 1 line should do the trick (adapted from https://stackoverflow.com/a/63329830)

Code: Select all

curl -OL http://mirrors.kernel.org/ubuntu/pool/main/libf/libffi/libffi6_3.2.1-9_i386.deb && dpkg -i libffi6_3.2.1-9_i386.deb && rm -f libffi6_3.2.1-9_i386.deb


Or for dockerfile (make sure curl is installed 1st)

Code: Select all

RUN curl -OLsS http://mirrors.kernel.org/ubuntu/pool/main/libf/libffi/libffi6_3.2.1-9_i386.deb && dpkg -i libffi6_3.2.1-9_i386.deb && rm -f libffi6_3.2.1-9_i386.deb

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 3 guests