Skip to content

Instantly share code, notes, and snippets.

@rderoldan1
Last active February 7, 2021 19:04
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • 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
    
@ifyouseewendy
Copy link

worked for me, thanks a lot!

@Vramin
Copy link

Vramin commented Dec 6, 2013

Finally! Thank you!

@mikeantonelli
Copy link

Worked perfectly, thanks!

@zhentuy
Copy link

zhentuy commented Jan 26, 2014

Thank u too~

@jaepyoung
Copy link

Thanks a lot.. I changed from el5 to el6 since mine is Redhat 6 and it works perfectly.

@lafolle
Copy link

lafolle commented Jun 12, 2014

Thanks

@levmichael3
Copy link

Thanks! helped me too :)

@FelipeMiranda
Copy link

Did not work for me!
Linux localhost 2.6.32-504.el6.x86_64 #1 SMP Tue Sep 16 01:56:35 EDT 2014 x86_64 x86_64 x86_64 GNU/Linux

@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

@nevros
Copy link

nevros 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