7

I have a CentOS 7 x86_64 installation onto which I want to install a package called frama-c. This package is not in the repos I have configured so far:

# yum search frama-c
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.datente.com
 * epel: epel.besthosting.ua
 * epel-testing: epel.besthosting.ua
 * extras: centos.mirror.iphh.net
 * updates: artfiles.org
Warning: No matches found for: frama-c
No matches found

I have downloaded the fullfilelist from https://dl.fedoraproject.org/pub/fedora/ and when I grep for frama-c the result looks promising:

$ grep 'development.*x86_64.*frama-c' fullfilelist.txt
./linux/development/26/Everything/x86_64/debug/tree/Packages/f/frama-c-debuginfo-1.14-1.fc26.x86_64.rpm
./linux/development/26/Everything/x86_64/os/Packages/f/frama-c-doc-1.14-1.fc26.noarch.rpm
./linux/development/26/Everything/x86_64/os/Packages/f/frama-c-emacs-1.14-1.fc26.noarch.rpm
./linux/development/26/Everything/x86_64/os/Packages/f/frama-c-xemacs-1.14-1.fc26.noarch.rpm
./linux/development/26/Everything/x86_64/os/Packages/f/frama-c-1.14-1.fc26.x86_64.rpm
./linux/development/rawhide/Everything/x86_64/debug/tree/Packages/f/frama-c-debuginfo-1.14-1.fc27.x86_64.rpm
./linux/development/rawhide/Everything/x86_64/os/Packages/f/frama-c-doc-1.14-1.fc27.noarch.rpm
./linux/development/rawhide/Everything/x86_64/os/Packages/f/frama-c-1.14-1.fc27.x86_64.rpm
./linux/development/rawhide/Everything/x86_64/os/Packages/f/frama-c-emacs-1.14-1.fc27.noarch.rpm
./linux/development/rawhide/Everything/x86_64/os/Packages/f/frama-c-xemacs-1.14-1.fc27.noarch.rpm

What is the proper way to add, say the rawhide repository to my current list of repos so I can install with a single yum install frama-c?

  • 2
    Have you considered running a Fedora environment in a Docker container? – mattdm Apr 25 '17 at 17:45
9

It is never good idea to mix packages for different systems. It might work, but you might encounter hard-to-debug problems. But most probably it will not work.

The best way is to rebuild the package for your system. Either you can ask the current package maintainer to do it for you (add EPEL7 package, which will show up in your EPEL repository) or do it on your own:

  • Download the latest SRPM package from Koji:

    wget https://kojipkgs.fedoraproject.org//packages/frama-c/1.14/1.fc27/src/frama-c-1.14-1.fc27.src.rpm
    
  • Rebuild it for your system (possibly resolve missing dependencies, if they are available):

    rpmbuild --rebuild frama-c-1.14-1.fc27.src.rpm
    
  • Install the package:

    yum install ~/rpmbuild/RPMS/.../path/../to/your.rpms
    
  • It is my understanding that CentOS is a Red Hat-clone, and Fedora is the Red Hat testing ground, so as a first approximation they should be "compatible". Is this too far fetched? I know there are no guarantees, but it's not like I'm trying to fit a square peg in a round hole, or am I? The problem with building frama-c from source is the tons of partially outdated dependencies, e.g. it needs ocaml 4.02 when CentOS 7 has as of today ocaml 4.01.1 -- and this is only the beginning. – Jens Apr 25 '17 at 11:13
  • The rpmbuild command stops with Installing frama-c-1.14-1.fc27.src.rpm, error: line 61: Unknown tag: Suggests: alt-ergo. Do you have a suggestion how to proceed? Thanks for taking the time to answer! – Jens Apr 25 '17 at 11:20
  • 1
    It is very far fetched. They are compatible by using the same packaging system -- rpm (therefore you can simply rebuild the packages as pointed out in this answer if you have the dependencies). But they have different kernel versions, gcc, glibc and many other libraries that are not always compatible. If some dependencies are older than needed, you might have more luck installing some package from older Fedora version, which should work with older ocaml (give a try to one or two years old for example). – Jakuje Apr 25 '17 at 11:20
  • The Suggests: is a new tag that is not known to RHEL rpm. You will need to remove it from the spec file, that is inside of the SRPM. – Jakuje Apr 25 '17 at 11:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.