going from CPAN to RPM

Discussion in 'Perl Misc' started by Art Werschulz, Feb 28, 2011.

  1. Hi all.

    Although we have used the CPAN shell to install Perl modules on our
    Linux systems, we would like to use the RPM versions of same instead.
    This means that we need to find out which Perl modules were installed
    via the CPAN shell, nuke same, and then install the RPM versions (say,
    via yum).

    How can we find out which Perl modules were installed via the CPAN
    shell?

    Thanks.

    --
    Art Werschulz (8-{)} "Metaphors be with you." -- bumper sticker
    GCS/M (GAT): d? -p+ c++ l++ u+ P++ e--- m* s n+ h f g+ w+ t+ r-
    Net: http://www.dsm.fordham.edu/~agw
    Phone: Fordham U. (212) 636-6325, Columbia U. (646) 775-6035
    Art Werschulz, Feb 28, 2011
    #1
    1. Advertising

  2. Art Werschulz

    smallpond Guest

    On Feb 27, 7:05 pm, Art Werschulz <> wrote:
    > Hi all.
    >
    > Although we have used the CPAN shell to install Perl modules on our
    > Linux systems, we would like to use the RPM versions of same instead.
    > This means that we need to find out which Perl modules were installed
    > via the CPAN shell, nuke same, and then install the RPM versions (say,
    > via yum).
    >
    > How can we find out which Perl modules were installed via the CPAN
    > shell?
    >


    rpm -qf <filename>

    returns the name of the rpm to which that file belongs.
    If it wasn't installed by rpm, it returns an error.
    smallpond, Feb 28, 2011
    #2
    1. Advertising

  3. Art Werschulz

    Justin C Guest

    On 2011-02-28, Art Werschulz <> wrote:
    > Hi all.
    >
    > Although we have used the CPAN shell to install Perl modules on our
    > Linux systems, we would like to use the RPM versions of same instead.
    > This means that we need to find out which Perl modules were installed
    > via the CPAN shell, nuke same, and then install the RPM versions (say,
    > via yum).
    >
    > How can we find out which Perl modules were installed via the CPAN
    > shell?


    perldoc -q "which modules are installed"

    Justin.

    --
    Justin C, by the sea.
    Justin C, Mar 2, 2011
    #3
  4. Hi.

    Justin C <> writes:

    > On 2011-02-28, Art Werschulz <> wrote:
    >> Hi all.
    >>
    >> Although we have used the CPAN shell to install Perl modules on our
    >> Linux systems, we would like to use the RPM versions of same instead.
    >> This means that we need to find out which Perl modules were installed
    >> via the CPAN shell, nuke same, and then install the RPM versions (say,
    >> via yum).
    >>
    >> How can we find out which Perl modules were installed via the CPAN
    >> shell?

    >
    > perldoc -q "which modules are installed"


    Not quite (I don't think). I want to know which modules have been
    installed via the CPAN shell, as opposed to which ones have been
    installed via RPMs.

    --
    Art Werschulz (8-{)} "Metaphors be with you." -- bumper sticker
    GCS/M (GAT): d? -p+ c++ l++ u+ P++ e--- m* s n+ h f g+ w+ t+ r-
    Net: http://www.dsm.fordham.edu/~agw
    Phone: Fordham U. (212) 636-6325, Columbia U. (646) 775-6035
    Art Werschulz, Mar 4, 2011
    #4
  5. On Fri, 04 Mar 2011 12:21:48 -0500, Art Werschulz wrote:

    > Hi.
    >
    > Justin C <> writes:
    >
    >> On 2011-02-28, Art Werschulz <> wrote:
    >>> Hi all.
    >>>
    >>> Although we have used the CPAN shell to install Perl modules on our
    >>> Linux systems, we would like to use the RPM versions of same instead.
    >>> This means that we need to find out which Perl modules were installed
    >>> via the CPAN shell, nuke same, and then install the RPM versions (say,
    >>> via yum).
    >>>
    >>> How can we find out which Perl modules were installed via the CPAN
    >>> shell?

    >>
    >> perldoc -q "which modules are installed"

    >
    > Not quite (I don't think). I want to know which modules have been
    > installed via the CPAN shell, as opposed to which ones have been
    > installed via RPMs.


    Maybe something like:

    sed 's/::/-/g's/^/perl-/ installed-modules.txt | xargs rpm -q

    At least on RedHat and derivatives. Dunno about other RPM distros.

    HTH
    M4
    Martijn Lievaart, Mar 4, 2011
    #5
  6. On 2011-03-04 20:28, Martijn Lievaart <> wrote:
    > On Fri, 04 Mar 2011 12:21:48 -0500, Art Werschulz wrote:
    >> Justin C <> writes:
    >>> On 2011-02-28, Art Werschulz <> wrote:
    >>>> Although we have used the CPAN shell to install Perl modules on our
    >>>> Linux systems, we would like to use the RPM versions of same instead.
    >>>> This means that we need to find out which Perl modules were installed
    >>>> via the CPAN shell, nuke same, and then install the RPM versions (say,
    >>>> via yum).
    >>>>
    >>>> How can we find out which Perl modules were installed via the CPAN
    >>>> shell?
    >>>
    >>> perldoc -q "which modules are installed"

    >>
    >> Not quite (I don't think). I want to know which modules have been
    >> installed via the CPAN shell, as opposed to which ones have been
    >> installed via RPMs.

    >
    > Maybe something like:
    >
    > sed 's/::/-/g's/^/perl-/ installed-modules.txt | xargs rpm -q
    >
    > At least on RedHat and derivatives. Dunno about other RPM distros.


    On Redhat, packages installed via RPM generally reside in vendor_perl,
    while packages installed via CPAN reside in site_perl. This may also be
    helpful in distinguishing them.

    hp
    Peter J. Holzer, Mar 5, 2011
    #6
  7. Hi.

    "Peter J. Holzer" <> writes:

    > On Redhat, packages installed via RPM generally reside in vendor_perl,
    > while packages installed via CPAN reside in site_perl.


    I'm not finding a vendor_perl subdirectory in /usr/lib/perl5.

    --
    Art Werschulz (8-{)} "Metaphors be with you." -- bumper sticker
    GCS/M (GAT): d? -p+ c++ l++ u+ P++ e--- m* s n+ h f g+ w+ t+ r-
    Net: http://www.dsm.fordham.edu/~agw
    Phone: Fordham U. (212) 636-6325, Columbia U. (646) 775-6035
    Art Werschulz, Mar 6, 2011
    #7
  8. On Sun, 06 Mar 2011 11:01:54 -0500, Art Werschulz wrote:

    > Hi.
    >
    > "Peter J. Holzer" <> writes:
    >
    >> On Redhat, packages installed via RPM generally reside in vendor_perl,
    >> while packages installed via CPAN reside in site_perl.

    >
    > I'm not finding a vendor_perl subdirectory in /usr/lib/perl5.


    I do, both on CentOS (RHEL) and Fedora. Are you sure you're on (a) RedHat
    (derivative)?

    M4
    Martijn Lievaart, Mar 6, 2011
    #8
  9. Hi.

    Martijn Lievaart <> writes:

    > On Sun, 06 Mar 2011 11:01:54 -0500, Art Werschulz wrote:
    >
    >> Hi.
    >>
    >> "Peter J. Holzer" <> writes:
    >>
    >>> On Redhat, packages installed via RPM generally reside in vendor_perl,
    >>> while packages installed via CPAN reside in site_perl.

    >>
    >> I'm not finding a vendor_perl subdirectory in /usr/lib/perl5.

    >
    > I do, both on CentOS (RHEL) and Fedora. Are you sure you're on (a) RedHat
    > (derivative)?


    I'm using Fedora 14.
    When I print the contents of @INC, I get
    /usr/local/lib/perl5
    /usr/local/share/perl5
    /usr/lib/perl5
    /usr/share/perl5
    /usr/lib/perl5
    /usr/share/perl5
    /usr/local/lib/perl5/site_perl/5.10.0/i386-linux-thread-multi
    /usr/local/lib/perl5/site_perl/5.10.0/i386-linux-thread-multi
    /usr/local/lib/perl5/site_perl/5.10.0
    /usr/lib/perl5/vendor_perl/5.10.0/i386-linux-thread-multi
    /usr/lib/perl5/vendor_perl
    /usr/lib/perl5/site_perl
    But:
    $ ls /usr/lib/perl5/vendor_perl
    ls: cannot access /usr/lib/perl5/vendor_perl: No such file or directory


    --
    Art Werschulz (8-{)} "Metaphors be with you." -- bumper sticker
    GCS/M (GAT): d? -p+ c++ l++ u+ P++ e--- m* s n+ h f g+ w+ t+ r-
    Net: http://www.dsm.fordham.edu/~agw
    Phone: Fordham U. (212) 636-6325, Columbia U. (646) 775-6035
    Art Werschulz, Mar 7, 2011
    #9
  10. On Sun, 06 Mar 2011 21:28:20 -0500, Art Werschulz wrote:

    > Hi.
    >
    > Martijn Lievaart <> writes:
    >
    >> On Sun, 06 Mar 2011 11:01:54 -0500, Art Werschulz wrote:
    >>
    >>> Hi.
    >>>
    >>> "Peter J. Holzer" <> writes:
    >>>
    >>>> On Redhat, packages installed via RPM generally reside in
    >>>> vendor_perl, while packages installed via CPAN reside in site_perl.
    >>>
    >>> I'm not finding a vendor_perl subdirectory in /usr/lib/perl5.

    >>
    >> I do, both on CentOS (RHEL) and Fedora. Are you sure you're on (a)
    >> RedHat (derivative)?

    >
    > I'm using Fedora 14.
    > When I print the contents of @INC, I get
    > /usr/local/lib/perl5
    > /usr/local/share/perl5
    > /usr/lib/perl5
    > /usr/share/perl5
    > /usr/lib/perl5
    > /usr/share/perl5
    > /usr/local/lib/perl5/site_perl/5.10.0/i386-linux-thread-multi
    > /usr/local/lib/perl5/site_perl/5.10.0/i386-linux-thread-multi
    > /usr/local/lib/perl5/site_perl/5.10.0
    > /usr/lib/perl5/vendor_perl/5.10.0/i386-linux-thread-multi
    > /usr/lib/perl5/vendor_perl
    > /usr/lib/perl5/site_perl
    > But:
    > $ ls /usr/lib/perl5/vendor_perl
    > ls: cannot access /usr/lib/perl5/vendor_perl: No such file or
    > directory


    Funny,

    When I do a "rpm -ql $(rpm -qa perl-*) | grep /usr/lib/perl5 | less" I
    see the modules about 50/50 using /usr/lib/perl/5.10.0/ and /usr/lib/
    perl5/vendor_perl/5.10.0/. So that is not reliable.

    M4
    Martijn Lievaart, Mar 14, 2011
    #10
  11. Hi.

    Martijn Lievaart <> writes:

    > When I do a "rpm -ql $(rpm -qa perl-*) | grep /usr/lib/perl5 | less" I
    > see the modules about 50/50 using /usr/lib/perl/5.10.0/ and /usr/lib/
    > perl5/vendor_perl/5.10.0/. So that is not reliable.


    The command
    rpm -qa perl-*
    produces no results for me, but
    rpm -qa | grep ^perl-
    works okay. But at any rate
    rpm -ql `rpm -qa perl-*` | grep /usr/lib/perl5 | grep vendor_perl
    produces no output whatsoever.


    --
    Art Werschulz (8-{)} "Metaphors be with you." -- bumper sticker
    GCS/M (GAT): d? -p+ c++ l++ u+ P++ e--- m* s n+ h f g+ w+ t+ r-
    Net: http://www.dsm.fordham.edu/~agw
    Phone: Fordham U. (212) 636-6325, Columbia U. (646) 775-6035
    Art Werschulz, Mar 14, 2011
    #11
  12. Art Werschulz wrote:

    > Hi.
    >
    > Martijn Lievaart <> writes:
    >
    >> When I do a "rpm -ql $(rpm -qa perl-*) | grep /usr/lib/perl5 | less" I
    >> see the modules about 50/50 using /usr/lib/perl/5.10.0/ and /usr/lib/
    >> perl5/vendor_perl/5.10.0/. So that is not reliable.

    >
    > The command
    > rpm -qa perl-*
    > produces no results for me, but


    You should protect the * from expansion by putting it in quotes or preceding
    it with a back slash. As it is now, the result completely depends on the
    contents of your current working directory. If by chance you have a file or
    directory named 'perl-blah' in your current working directory, you will
    only search for perl-bla.

    So use:

    rpm -qa 'perl-*'

    --
    Paul Uiterlinden
    www.aimvalley.nl
    e-mail addres: remove the not.
    Paul Uiterlinden, Mar 15, 2011
    #12
  13. On Mon, 14 Mar 2011 08:18:47 -0400, Art Werschulz wrote:

    > works okay. But at any rate
    > rpm -ql `rpm -qa perl-*` | grep /usr/lib/perl5 | grep vendor_perl
    > produces no output whatsoever.


    Maybe they changed the packaging between F12 and F14, I get plenty of
    output.

    M4
    Martijn Lievaart, Mar 15, 2011
    #13
  14. Hi.

    Paul Uiterlinden <> writes:

    > You should protect the * from expansion by putting it in quotes or
    > preceding it with a back slash. As it is now, the result completely
    > depends on the contents of your current working directory. If by
    > chance you have a file or directory named 'perl-blah' in your current
    > working directory, you will only search for perl-bla.
    >
    > So use:
    >
    > rpm -qa 'perl-*'


    Oops. Silly blunder on my part, and I should know better.
    But getting back to the original issue: the command
    rpm -ql `rpm -qa perl-\*`|grep vendor
    produces no output.

    --
    Art Werschulz (8-{)} "Metaphors be with you." -- bumper sticker
    GCS/M (GAT): d? -p+ c++ l++ u+ P++ e--- m* s n+ h f g+ w+ t+ r-
    Net: http://www.dsm.fordham.edu/~agw
    Phone: Fordham U. (212) 636-6325, Columbia U. (646) 775-6035
    Art Werschulz, Mar 16, 2011
    #14
  15. On Wed, 16 Mar 2011 12:01:53 -0400, Art Werschulz wrote:

    > Oops. Silly blunder on my part, and I should know better. But getting
    > back to the original issue: the command
    > rpm -ql `rpm -qa perl-\*`|grep vendor
    > produces no output.


    So this is a dead end. However, as the names of the Perl modules and the
    RPMs correspond one to one in my experience:

    - Get a list of installed modules (see FAQ) >installed-modules.txt
    - sed 's/::/-/g's/^/perl-/ installed-modules.txt | xargs rpm -q

    Haven't tried it, so I cannot say it works, but it should.

    HTH,
    M4
    Martijn Lievaart, Mar 16, 2011
    #15
  16. On 2011-03-16 16:58, Martijn Lievaart <> wrote:
    > On Wed, 16 Mar 2011 12:01:53 -0400, Art Werschulz wrote:
    >> Oops. Silly blunder on my part, and I should know better. But getting
    >> back to the original issue: the command
    >> rpm -ql `rpm -qa perl-\*`|grep vendor
    >> produces no output.

    >
    > So this is a dead end. However, as the names of the Perl modules and the
    > RPMs correspond one to one in my experience:
    >
    > - Get a list of installed modules (see FAQ) >installed-modules.txt
    > - sed 's/::/-/g's/^/perl-/ installed-modules.txt | xargs rpm -q


    The RPM is usually named after the distribution, not the module. So that
    works for many modules, but not for all. For example, LWP::Simple is
    included in the distribution libwww-perl, so the RPM is called
    perl-libwww-perl.

    hp
    Peter J. Holzer, Mar 17, 2011
    #16
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Scott Chapman
    Replies:
    0
    Views:
    335
    Scott Chapman
    Oct 3, 2003
  2. Cliff Wells
    Replies:
    1
    Views:
    329
    Paul Boddie
    Oct 13, 2003
  3. Zhi Min
    Replies:
    0
    Views:
    386
    Zhi Min
    Jun 11, 2004
  4. Steven W. Orr
    Replies:
    1
    Views:
    268
    Steven W. Orr
    Mar 4, 2011
  5. carl d.
    Replies:
    1
    Views:
    369
    A. Sinan Unur
    May 10, 2005
Loading...

Share This Page