Skip to content

Instantly share code, notes, and snippets.

@rderoldan1
Last active February 7, 2021 19:04
Show Gist options
  • Save rderoldan1/5920539 to your computer and use it in GitHub Desktop.
Save rderoldan1/5920539 to your computer and use it in GitHub Desktop.
Install libffi-devel

The problem

While I was configuring Ruby on Rails in a Red Hat (CentOS) with RVM I found a problem with the library libffi-devel because the package wasn't available via yum install, after search for a couple of days I found this solution.

Add rpmforge as a repository

  1. Create a repo file in /etc/yum.repos.d/rpmforge.repo, you need to be an admin
  2. Copy the following text.
#Name: RPMforge RPM Repository for Red Hat Enterprise 5 - dag
   #URL: http://rpmforge.net/
   [rpmforge]
    name = Red Hat Enterprise $releasever - RPMforge.net - dag
    #baseurl = http://apt.sw.be/redhat/el5/en/$basearch/dag
    mirrorlist = http://apt.sw.be/redhat/el5/en/mirrors-rpmforge
    #mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge
    enabled = 1
    protect = 0
    gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
    gpgcheck = 1
  1. Download the the rpmforge gpg key

     $ sudo rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
    
  2. Install the package via yum

     $ sudo yum install libffi-devel
    
@ixe013
Copy link

ixe013 commented Jan 27, 2015

Indentation in step 2 above is wrong. Left align every line it should work.

#Name: RPMforge RPM Repository for Red Hat Enterprise 5 - dag
#URL: http://rpmforge.net/
[rpmforge]
name = Red Hat Enterprise $releasever - RPMforge.net - dag
#baseurl = http://apt.sw.be/redhat/el5/en/$basearch/dag
mirrorlist = http://apt.sw.be/redhat/el5/en/mirrors-rpmforge
#mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge
enabled = 1
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
gpgcheck = 1

@smhjamalii
Copy link

good job!

@qcreator
Copy link

qcreator commented Mar 7, 2015

Perfect! THX!

@marta-lokhova
Copy link

Thank you! Works great!

@betesh
Copy link

betesh commented Aug 5, 2015

Worked for me on:

$ cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 6.4 (Santiago)

@WangErGou
Copy link

Thank you

@ailjushkin
Copy link

Thank you. I tried to install it on my el6. I've also tried to change el5 to el6 in links inside of your repo file and there's no libffi-devel!
It's only in el5 as you wrote.
So...

Copy link

ghost commented Aug 2, 2016

Nice! Thank you

@oden3000
Copy link

oden3000 commented Sep 6, 2016

http://apt.sw.be/ is returning a 404

@patil-rahul
Copy link

patil-rahul commented Feb 7, 2021

Looks like apt.sw.be is not available.

[root@hostname ~]# sudo rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
error: http://apt.sw.be/RPM-GPG-KEY.dag.txt: import read failed(-1).

Copied the above file from https://github.com/repoforge/repo-files/blob/master/repo/RPM-GPG-KEY.dag.txt

[root@hostname ~]# sudo yum install libffi-devel
Could not retrieve mirrorlist http://apt.sw.be/redhat/el5/en/mirrors-rpmforge error was
[Errno 4] IOError: <urlopen error (-2, 'Name or service not known')>
Error: Cannot retrieve repository metadata (repomd.xml) for repository: rpmforge. Please verify its path and try again

Please help. RHEL 5.11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment