Search code examples
unixrpmrhel

Find which distrubtion a RPM belongs to ? RHEL or Centos or Suse


How do I find to which distribution (for example, RHEL or Centos or Suse) a RPM file belongs to?

I have a RHEL box, can I use RPM provided at link, https://dl.fedoraproject.org/pub/epel/6/x86_64/repoview/libRmath.html


Solution

  • Yes, you can determine the original package source for an RPM. The RPM header has a wealth of information about the package, including the Vendor and Packager.

    To view the information on a package, use the rpm command as follows:

    rpm -q -i -p libRmath-3.2.3-4.el6.x86_64.rpm
    

    -q means to query the RPM file

    -i prints out the information contained in the RPM header

    -p Points RPM to the file to query. You can also pass it a URL if desired.

    For the package you mentioned, here is the output of the above command:

    warning: libRmath-3.2.3-4.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
    Name        : libRmath
    Version     : 3.2.3
    Release     : 4.el6
    Architecture: x86_64
    Install Date: (not installed)
    Group       : Development/Libraries
    Size        : 242971
    License     : GPLv2+
    Signature   : RSA/SHA256, Wed 27 Jan 2016 01:29:08 PM PST, Key ID 3b49df2a0608b895
    Source RPM  : R-3.2.3-4.el6.src.rpm
    Build Date  : Tue 26 Jan 2016 02:22:41 PM PST
    Build Host  : buildvm-26.phx2.fedoraproject.org
    Relocations : (not relocatable)
    Packager    : Fedora Project
    Vendor      : Fedora Project
    URL         : http://www.r-project.org
    Summary     : Standalone math library from the R project
    Description :
    A standalone library of mathematical and statistical functions derived
    from the R project.  This package provides the shared libRmath library.
    

    Whether or not the RPM is compatible with the system you are trying to install it on is a different issue. You can either do it by testing or stick with a distribution you know to have a similar set of libraries as your target system.