Tutorial details | |
---|---|
Difficulty | Easy (rss) |
Root privileges | No |
Requirements | None |
Time | N/A |
Task: List installed perl module
To display the list enter the following command:
$ instmodsh
Sample outputs:
Available commands are: l - List all installed modules m - Select a module q - Quit the program cmd?
At cmd? prompt type l to list all installed modules:
cmd? l
Sample outputs:
Installed modules are: Archive::Tar CPAN Class::Spiffy Compress::Zlib Cwd Digest::SHA IO::Zlib MIME::Lite Module::Build Module::Signature Net::Telnet PAR::Dist Perl Spiffy Term::ReadLine Test::Base Test::Simple Text::Glob Weather::Com XML::Simple YAML cmd?
This command itself is a perl script that use ExtUtils::Installed module. Try following command to see its source code:
$ vi $(which instmodsh)
🐧 Please support my work on Patreon or with a donation.
🐧 Get the latest tutorials on Linux, Open Source & DevOps via:
🐧 Get the latest tutorials on Linux, Open Source & DevOps via:
- RSS feed or Weekly email newsletter
- Share on Twitter • Facebook • 20 comments... add one ↓
Category | List of Unix and Linux commands |
---|---|
File Management | cat |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Network Utilities | dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time |
Searching | grep • whereis • which |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |
Thanks, helpful tool.
While looking for how to do this I also came across this as an option:
$ perldoc perllocal
Will print out all your installed modules as well as when they were installed and where as well as a couple of other bits of info. You can direct the output to a file as well which is handy.
Thanks, it’s useful for me too.
enter
m Perl
then enter an f
to see details of perl packages.
Thnx
Use the following command on Unix/Linux to find Perl moduls installed
on your system:
find `perl -e ‘print “@INC”‘ ` -name ‘*.pm’ -print > all_modsOnSys
Hi Friend,
syntax error at -e line 1, near “.”
Execution of -e aborted due to compilation errors.
find: path-list predicate-list
Pls update. Ashok1729 :-)( Don’t give ur knowledge to others, just share it.
syntax error at -e line 1, near “.”
Execution of -e aborted due to compilation errors.
find: path-list predicate-list
above poster is a noob:
find `perl -e ‘print “@INC”‘` -name ‘*.pm’ -print | tee ~/Perl-modules-installed.txt
Or better yet:
find `perl -e 'print "@INC"'` -name '*.pm' -print | tee ~/Perl-modules-installed.txt
(Hopefully the above appears in a more copy and paste friendly format)
to have * all* modules listed, a minor modification is required:
find `perl -e '{print join $/, grep {/[^.]/} @INC}'` -name '*pm' 2>/dev/null
to have * all* modules listed, a minor modification is required:
find -L `perl -e '{print join $/, grep {/[^.]/} @INC}'` -name '*pm' 2>/dev/null
sorry, the -L was accidentally missing from my post . It is required for find to raverse symlinks, and Perl 5.8.8. is such
find -L `perl -e '{print join $/, grep {/[^.]/} @INC}’` -name ‘*pm’ 2>/dev/null
I banged up a quick script to list them when i came across this issue a while back:
use ExtUtils::Installed;
my $Inst = ExtUtils::Installed->new();
my @Modules = $Inst->modules();
print "Current List of Installed PERL Modules:\n\n";
foreach my $mod(@Modules){
print "$mod\n";
}
Try perl module manager to install and uninstall perl module.
http://sourceforge.net/projects/perlmod/
Use perl module manager to install perl modules and all dependent modules,Uninstall perl modules,List all perl modules in system,Search for a perl module in cpan.org and system,List all files of a perl module and Details of a perl module.
@serguei wrote (11):
so I tried it and got an error:
BUT (9):
works
The -L option at comment (10) doesnt:
find -L `perl -e ‘{print join $/, grep {/[^.]/} @INC}’` -name ‘*pm’ 2>/dev/null
AlmostDaly wrote (12):
That’s fine if you have the ExtUtils CPAN module installed as standard. But can we assume this is always present?
Not assuming… but install it. Why wouldn’t you, its hardly ideal to run these long commands when you can alias a script to list them…
Hello All,
None of the above helped me. I tried copy paste but no luck. I probably don’t need to do any of the above.
I just need to find out if Gtk is installed on my system(Mac Leopard), I tried using Gtk in but it can’t find anything called Gtk…please help,
Thanks,
LisPerlati
Use this command to check wheter the module is installed or not:
perl -e ‘use File::Compare; print “ok\n”‘
Thanks all , Its really helpful.
Thanks you it was very helpfull
Thanx, helpful..