going from CPAN to RPM

A

Art Werschulz

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.
 
S

smallpond

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.
 
J

Justin C

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.
 
A

Art Werschulz

Hi.

Justin C said:
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.
 
M

Martijn Lievaart

Hi.



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
 
P

Peter J. Holzer

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
 
A

Art Werschulz

Hi.

Peter J. Holzer said:
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.
 
M

Martijn Lievaart

Hi.



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
 
A

Art Werschulz

Hi.

Martijn Lievaart said:
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
 
M

Martijn Lievaart

Hi.



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
 
A

Art Werschulz

Hi.

Martijn Lievaart said:
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.
 
P

Paul Uiterlinden

Art said:
Hi.



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-*'
 
M

Martijn Lievaart

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
 
A

Art Werschulz

Hi.

Paul Uiterlinden said:
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.
 
M

Martijn Lievaart

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
 
P

Peter J. Holzer

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top