≡ Menu

How To Resolve – CPAN.pm needs tar, gzip and bzip2 installed – error message

[CPAN Logo]Issue: You have tar, gzip and bzip2 working properly on your server. However, you are getting “CPAN.pm needs either the external programs tar, gzip and bzip2 installed. Can’t continue.” error message while installing a perl module using cpan. This article explains how to solve this problem.
 
Also, please refer to our previous article on How To Install Perl Modules using manual and cpan method.

Solution:

The error happens because CPAN is not aware of tar, bzip2 and gzip file location. Configure these locations as shown below.

# perl -MCPAN -eshell

cpan shell -- CPAN exploration and modules installation (v1.9205)
ReadLine support available (maybe install Bundle::CPAN or Bundle::CPANxxl?)

cpan[1]> o conf tar /bin/tar
tar  [/bin/tar]
Please use 'o conf commit' to make the config permanent!

cpan[2]> o conf bzip2 /bin/bzip2
bzip2 [/bin/bzip2]
Please use 'o conf commit' to make the config permanent!

cpan[3]> o conf gzip /bin/gzip
gzip   [/bin/gzip]
Please use 'o conf commit' to make the config permanent!

cpan[4]>  o conf commit
commit: wrote '/usr/lib/perl5/5.10.0/CPAN/Config.pm'

cpan[5]> quit
No history written (no histfile specified).
Lockfile removed.

Make sure to perform commit to save the configuration changes as shown above.

Add your comment

If you enjoyed this article, you might also like..

  1. 50 Linux Sysadmin Tutorials
  2. 50 Most Frequently Used Linux Commands (With Examples)
  3. Top 25 Best Linux Performance Monitoring and Debugging Tools
  4. Mommy, I found it! – 15 Practical Linux Find Command Examples
  5. Linux 101 Hacks 2nd Edition eBook Linux 101 Hacks Book

Bash 101 Hacks Book Sed and Awk 101 Hacks Book Nagios Core 3 Book Vim 101 Hacks Book