Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

cpan install fails with bad tar call

by RockyRoccoco (Initiate)
on Apr 24, 2019 at 15:40 UTC ( #1232953=perlquestion: print w/replies, xml ) Need Help??

RockyRoccoco has asked for the wisdom of the Perl Monks concerning the following question:

I just installed Strawberry perl using standard install choices. I have attempted in the "perl (command line)" window to install several required modules. I also have msys2 installed on this machine. I think there is some interference between msys2 and windows. Here is the result of trying to install a package: Install command:
cpan install Gedcom
Loading internal logger. Log::Log4perl recommended for better logging Reading '\c\Users\Owner\.cpan\Metadata' Database was generated on Tue, 23 Apr 2019 23:29:03 GMT Running install for module 'Gedcom' CPAN: Digest::SHA loaded ok (v6.02) CPAN: Compress::Zlib loaded ok (v2.081) Checksum for \c\Users\Owner\.cpan\sources\authors\id\P\PJ\PJCJ\Gedcom- +1.20.tar.gz ok The system cannot find the path specified. Uncompressed \c\Users\Owner\.cpan\sources\authors\id\P\PJ\PJCJ\Gedcom- +1.20.tar.gz successfully Using Tar:/usr/bin/tar xf "Gedcom-1.20.tar": The system cannot find the path specified. Couldn't untar Gedcom-1.20.tar: child exited with value 1 CPAN: YAML loaded ok (v1.27) PJCJ/Gedcom-1.20.tar.gz Had problems unarchiving. Please build manually
I need to keep msys2 in this machine. Any thoughts on how to get perl to use the correct tar, or the correct path form?

Replies are listed 'Best First'.
Re: cpan install fails with bad tar call
by soonix (Canon) on Apr 24, 2019 at 20:54 UTC
    After rereading the thread referenced by thanos1983, my question is: Do you happen to have Perl (or msys) installed somewhere under C:\Program Files (or C:\Program Files (x86))? If so, that would most probably be the cause of the problem.
Re: cpan install fails with bad tar call
by thanos1983 (Parson) on Apr 24, 2019 at 16:45 UTC

    Hello RockyRoccoco,

    Welcome to the Monastery. You can read this previously asked question CPAN module installs failing. Possibly the solution will work on your case also.

    Let us know.

    BR / Thanos

    Seeking for Perl wisdom...on the process of learning...not there...yet!
      I've looked at it. DIfferent OS, path referred to is not found currently, no component of the path is found. So, no. But it is possibly a good direction. I need to know where to correct tar is located on my windows 10 system. I also am trying to figure out how to separate msys2 from regular windows programs. That's probably what is going on.
        I need to know where to correct tar is located on my windows 10 system

        In my experience, you can use whichever tar you like - but I don't think the cpan utility that ships with my my Strawberry Perls uses "tar" at all.
        (I guess they use Archive::Tar.)

        Looks to me that your C:\Users\Owner\.cpan\ has been written for msys2's perl - not for Strawberry Perl.

        That being so, the solution would be to have separate cpan home directories for Strawberry Perl and msys2's perl.

        Other than that, it might be handy if you could show us a copy of your
        Please first remove any sensitive information contained therein.

        Certainly something that has been written for an msys2 perl is being accessed as both "/usr/bin/tar" and "/c/Users/Owner/..." are paths that would work fine in in an msys2 shell.
        However, if backslashes are substituted for forward slashes, not even msys2 will be able to make sense of them.

Re: cpan install fails with bad tar call
by swl (Priest) on Apr 24, 2019 at 23:13 UTC

    Check which cpan is being called. You are probably using the version from msys2, which is why it then looks for /usr/bin/tar.

    On my system:

    where cpan C:\berrybrew\5.28.0_64_PDL\perl\bin\cpan.bat

    If you are running the portable shell that comes with Strawberry Perl then it should put all the strawberry paths at the front of %PATH%. Perhaps double check that you are using that shell.

    And FWIW, I have MSYS2 and several versions of Strawberry perl installed on my system (via Berrybrew) and they don't interfere with each other. That said, none of them are in my default path. I only ever start MSYS2 from its menu option, and strawberry perl via a bat file that prepends the paths (similar to what its portable shell does).

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1232953]
Approved by Paladin
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2021-05-17 12:32 GMT
Find Nodes?
    Voting Booth?
    Perl 7 will be out ...

    Results (154 votes). Check out past polls.