How To Install python3-cffi on CentOS 8

python3-cffi is Foreign Function Interface for Python 3 to call C code

Introduction

In this tutorial we learn how to install python3-cffi on CentOS 8.

What is python3-cffi

Foreign Function Interface for Python, providing a convenient and reliable way of calling existing C code from Python. The interface is based on LuaJIT’s FFI.

We can use yum or dnf to install python3-cffi on CentOS 8. In this tutorial we discuss both methods but you only need to choose one of method to install python3-cffi.

Install python3-cffi on CentOS 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install python3-cffi using dnf by running the following command:

sudo dnf -y install python3-cffi

Install python3-cffi on CentOS 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install python3-cffi using yum by running the following command:

sudo yum -y install python3-cffi

How To Uninstall python3-cffi on CentOS 8

To uninstall only the python3-cffi package we can use the following command:

sudo dnf remove python3-cffi

python3-cffi Package Contents on CentOS 8

/usr/lib/.build-id
/usr/lib/.build-id/8d
/usr/lib/.build-id/8d/f408c06fcca5201e61b0ffbaefd2c6f38ebacb
/usr/lib64/python3.6/site-packages/_cffi_backend.cpython-36m-x86_64-linux-gnu.so
/usr/lib64/python3.6/site-packages/cffi
/usr/lib64/python3.6/site-packages/cffi-1.11.5-py3.6.egg-info
/usr/lib64/python3.6/site-packages/cffi-1.11.5-py3.6.egg-info/PKG-INFO
/usr/lib64/python3.6/site-packages/cffi-1.11.5-py3.6.egg-info/SOURCES.txt
/usr/lib64/python3.6/site-packages/cffi-1.11.5-py3.6.egg-info/dependency_links.txt
/usr/lib64/python3.6/site-packages/cffi-1.11.5-py3.6.egg-info/entry_points.txt
/usr/lib64/python3.6/site-packages/cffi-1.11.5-py3.6.egg-info/installed-files.txt
/usr/lib64/python3.6/site-packages/cffi-1.11.5-py3.6.egg-info/not-zip-safe
/usr/lib64/python3.6/site-packages/cffi-1.11.5-py3.6.egg-info/requires.txt
/usr/lib64/python3.6/site-packages/cffi-1.11.5-py3.6.egg-info/top_level.txt
/usr/lib64/python3.6/site-packages/cffi/__init__.py
/usr/lib64/python3.6/site-packages/cffi/__pycache__
/usr/lib64/python3.6/site-packages/cffi/__pycache__/__init__.cpython-36.opt-1.pyc
/usr/lib64/python3.6/site-packages/cffi/__pycache__/__init__.cpython-36.pyc
/usr/lib64/python3.6/site-packages/cffi/__pycache__/api.cpython-36.opt-1.pyc
/usr/lib64/python3.6/site-packages/cffi/__pycache__/api.cpython-36.pyc
/usr/lib64/python3.6/site-packages/cffi/__pycache__/backend_ctypes.cpython-36.opt-1.pyc
/usr/lib64/python3.6/site-packages/cffi/__pycache__/backend_ctypes.cpython-36.pyc
/usr/lib64/python3.6/site-packages/cffi/__pycache__/cffi_opcode.cpython-36.opt-1.pyc
/usr/lib64/python3.6/site-packages/cffi/__pycache__/cffi_opcode.cpython-36.pyc
/usr/lib64/python3.6/site-packages/cffi/__pycache__/commontypes.cpython-36.opt-1.pyc
/usr/lib64/python3.6/site-packages/cffi/__pycache__/commontypes.cpython-36.pyc
/usr/lib64/python3.6/site-packages/cffi/__pycache__/cparser.cpython-36.opt-1.pyc
/usr/lib64/python3.6/site-packages/cffi/__pycache__/cparser.cpython-36.pyc
/usr/lib64/python3.6/site-packages/cffi/__pycache__/error.cpython-36.opt-1.pyc
/usr/lib64/python3.6/site-packages/cffi/__pycache__/error.cpython-36.pyc
/usr/lib64/python3.6/site-packages/cffi/__pycache__/ffiplatform.cpython-36.opt-1.pyc
/usr/lib64/python3.6/site-packages/cffi/__pycache__/ffiplatform.cpython-36.pyc
/usr/lib64/python3.6/site-packages/cffi/__pycache__/lock.cpython-36.opt-1.pyc
/usr/lib64/python3.6/site-packages/cffi/__pycache__/lock.cpython-36.pyc
/usr/lib64/python3.6/site-packages/cffi/__pycache__/model.cpython-36.opt-1.pyc
/usr/lib64/python3.6/site-packages/cffi/__pycache__/model.cpython-36.pyc
/usr/lib64/python3.6/site-packages/cffi/__pycache__/recompiler.cpython-36.opt-1.pyc
/usr/lib64/python3.6/site-packages/cffi/__pycache__/recompiler.cpython-36.pyc
/usr/lib64/python3.6/site-packages/cffi/__pycache__/setuptools_ext.cpython-36.opt-1.pyc
/usr/lib64/python3.6/site-packages/cffi/__pycache__/setuptools_ext.cpython-36.pyc
/usr/lib64/python3.6/site-packages/cffi/__pycache__/vengine_cpy.cpython-36.opt-1.pyc
/usr/lib64/python3.6/site-packages/cffi/__pycache__/vengine_cpy.cpython-36.pyc
/usr/lib64/python3.6/site-packages/cffi/__pycache__/vengine_gen.cpython-36.opt-1.pyc
/usr/lib64/python3.6/site-packages/cffi/__pycache__/vengine_gen.cpython-36.pyc
/usr/lib64/python3.6/site-packages/cffi/__pycache__/verifier.cpython-36.opt-1.pyc
/usr/lib64/python3.6/site-packages/cffi/__pycache__/verifier.cpython-36.pyc
/usr/lib64/python3.6/site-packages/cffi/_cffi_errors.h
/usr/lib64/python3.6/site-packages/cffi/_cffi_include.h
/usr/lib64/python3.6/site-packages/cffi/_embedding.h
/usr/lib64/python3.6/site-packages/cffi/api.py
/usr/lib64/python3.6/site-packages/cffi/backend_ctypes.py
/usr/lib64/python3.6/site-packages/cffi/cffi_opcode.py
/usr/lib64/python3.6/site-packages/cffi/commontypes.py
/usr/lib64/python3.6/site-packages/cffi/cparser.py
/usr/lib64/python3.6/site-packages/cffi/error.py
/usr/lib64/python3.6/site-packages/cffi/ffiplatform.py
/usr/lib64/python3.6/site-packages/cffi/lock.py
/usr/lib64/python3.6/site-packages/cffi/model.py
/usr/lib64/python3.6/site-packages/cffi/parse_c_type.h
/usr/lib64/python3.6/site-packages/cffi/recompiler.py
/usr/lib64/python3.6/site-packages/cffi/setuptools_ext.py
/usr/lib64/python3.6/site-packages/cffi/vengine_cpy.py
/usr/lib64/python3.6/site-packages/cffi/vengine_gen.py
/usr/lib64/python3.6/site-packages/cffi/verifier.py
/usr/share/doc/python3-cffi
/usr/share/doc/python3-cffi/PKG-INFO
/usr/share/licenses/python3-cffi
/usr/share/licenses/python3-cffi/LICENSE

References

Summary

In this tutorial we learn how to install python3-cffi on CentOS 8 using yum and dnf.