Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install perlbrew on Fedora 20 #409

Closed
mannih opened this issue Sep 16, 2014 · 36 comments

Comments

@mannih
Copy link

commented Sep 16, 2014

curl -kL http://install.perlbrew.pl | bash
...
Can't locate List/Util.pm in @INC (you may need to install the List::Util module)
(@INC contains: FatPacked::39801144=HASH(0x25f5138)
/usr/share/perl5
/usr/lib64/perl5
/usr/local/share/perl5
/usr/local/lib64/perl5)
at perlbrew-25712 line 33.

Notice the directories reported to make up @INC.

perl -V
...
@INC:
    /usr/local/lib64/perl5
    /usr/local/share/perl5
    /usr/lib64/perl5/vendor_perl
    /usr/share/perl5/vendor_perl
    /usr/lib64/perl5
    /usr/share/perl5

List::Util can be found in /usr/lib64/perl5/vendor_perl

Obviously, setting up @INC leaves out relevant directories.

@voidcontext

This comment has been minimized.

Copy link

commented Sep 19, 2014

+1

@damaya1982

This comment has been minimized.

Copy link

commented Sep 22, 2014

If you're wanting to use it now, and you don't have time to wait for this to be fixed:

  1. grab perlbrew script (https://raw.githubusercontent.com/gugod/App-perlbrew/develop/perlbrew)
  2. Change the following line (line 3) from/to (i.e., add vendorlib):

BEFORE:
BEGIN { use Config; @INC = @Config{qw(privlibexp archlibexp sitelibexp sitearchexp)} };
AFTER:
BEGIN { use Config; @INC = @Config{qw(privlibexp archlibexp sitelibexp sitearchexp vendorlib)} };

  1. Now run the script:
    /usr/bin/perl perlbrew self-install && /usr/bin/perl perlbrew -f -q install-patchperl
  2. You may need to install a few cpan modules. I had to install encode:
    yum -y install perl-App-cpanminus
    cpanm Encode
@rahed

This comment has been minimized.

Copy link

commented Sep 23, 2014

I added vendorlib to BEGIN, now @inc contains also /usr/share/perl5/vendor_perl, but List::Util is in /usr/lib64/perl5/vendor_perl

@damaya1982

This comment has been minimized.

Copy link

commented Sep 24, 2014

I'm not sure Rahed, what I had suggested did work for me on CentOS 7. Maybe you could try adding vendorarch to BEGIN? Let me know if that works.

@gugod

This comment has been minimized.

Copy link
Owner

commented Sep 24, 2014

@rahed

This comment has been minimized.

Copy link

commented Sep 25, 2014

Yes, in the meantime I added also vendorarch and it works. It is RedHat, version 7.0.

@wumpus

This comment has been minimized.

Copy link

commented Oct 9, 2014

On RHEL7/CentOS7 I had to add both vendorlib and vendorarchexp to @inc.

@sestaton

This comment has been minimized.

Copy link

commented Jan 8, 2015

On Fedora 21, adding vendorlib and vendorarchexp did not solve the issue, but adding '/usr/share/perl5/vendor_perl' to @inc manually solved the issue for me. So, I changed line 3 to:

BEGIN { use Config; @INC = @Config{qw(privlibexp archlibexp sitelibexp sitearchexp)}; push @INC, '/usr/share/perl5/vendor_perl'; };

and ran the command reference above:

/usr/bin/perl perlbrew self-install && /usr/bin/perl perlbrew -f -q install-patchperl

I also installed a couple of modules through the package manager prior to making this change (List::Util and File::Spec, after installing CPAN), but setting the @inc path correctly may be all that is necessary.

EDIT: I should add that the self-upgrade function won't work with this method but everything else appears to work fine.

@mvuets

This comment has been minimized.

Copy link
Contributor

commented Jan 13, 2015

I confirm the problem still exists on Fedora 21:

$ curl -sL http://install.perlbrew.pl | bash

## Download the latest perlbrew

## Installing perlbrew
Can't locate Getopt/Long.pm in @INC (you may need to install the Getopt::Long module) (@INC contains: FatPacked::21640192=HASH(0x14a3400) /usr/share/perl5 /usr/lib64/perl5 /usr/local/share/perl5 /usr/local/lib64/perl5) at perlbrew-27523 line 33.
BEGIN failed--compilation aborted at perlbrew-27523 line 33.
Compilation failed in require at perlbrew-27523 line 5830.
BEGIN failed--compilation aborted at perlbrew-27523 line 5830.
@markwellis

This comment has been minimized.

Copy link

commented Jan 14, 2015

this bit me on centos 7, fixed by following @wumpus's comment above

grim8634 added a commit to grim8634/App-perlbrew that referenced this issue Jan 15, 2015

@ViktorNacht

This comment has been minimized.

Copy link

commented Jan 23, 2015

Here's a one-liner for installing onto CentOS 7. Self-Upgrade still fails, use at your own risk. I needed it for a deployment script, plus it was fun. :) Probably very brittle to changes in the source.

curl -kL http://install.perlbrew.pl | sed "/\$PERLBREWDOWNLOAD/{N;s|$|sed -i -r '/@INC/ s/([)][}])/ vendorlib vendorarch\\\1/' \\\$LOCALINSTALLER\n|}" | bash

As a Gist: https://gist.github.com/ViktorNacht/56ae6617734f28e2b1b3

@nnutter

This comment has been minimized.

Copy link

commented Mar 14, 2015

As pointed out installation is broken on Fedora 21. Getopt::Long, File::Path, and Pod::Usage all need to come from vendorlibexp. I hacked things on my fork to get everything through. Hopefully you can use it to make a reasonable patch.

$ ( export PERLBREWURL=https://github.com/nnutter/App-perlbrew/raw/develop/perlbrew; \curl -L http://install.perlbrew.pl | \bash )
...
## Done.
$ source ~/.perlbrew/etc/bashrc
$ perlbrew --version
/home/nnutter/.perlbrew/bin/perlbrew  - App::perlbrew/0.73
$ perl -MConfig -MFile::Path -MPod::Usage -MGetopt::Long -e 'print join(qq(\n), @INC{qw(Pod/Usage.pm Getopt/Long.pm File/Path.pm)}, $Config{vendorlibexp}), qq(\n)'
/usr/share/perl5/vendor_perl/Pod/Usage.pm
/usr/share/perl5/vendor_perl/Getopt/Long.pm
/usr/share/perl5/vendor_perl/File/Path.pm
/usr/share/perl5/vendor_perl
@sestaton

This comment has been minimized.

Copy link

commented Mar 26, 2015

The command @nnutter posted above will install perlbrew without any modifications on Fedora now, but the self-upgrade command is still broken (similar to other solutions posted). It looks like that method calls self-install which is using the system Perl and customizing the shebang to the system PATH (I think), so you still get:

Can't locate Getopt/Long.pm in @INC ...

I guess a fix would have to involve the code in those upgrade/install methods, or elsewhere, to extend the include path somehow.

@zdm

This comment has been minimized.

Copy link

commented May 7, 2015

+1
When this patch will be added and released?

@nnutter

This comment has been minimized.

Copy link

commented May 7, 2015

@zdm My "fix" is a crappy hack and not something they can merge.

@zdm

This comment has been minimized.

Copy link

commented May 7, 2015

I understand.
I think, this is not so complex to add vendorlib and vendorarchexp to the several places in code.
This is critical bug, perlbrew doesn't work under very popular centos at all.
What was the reason to ignore vendor libs?

@gugod

This comment has been minimized.

Copy link
Owner

commented May 11, 2015

There was intention to exclude vendorlib -- perlbrew really is merely just a collection of system-specific hacks. Unfortunately, most of them being OSX, and some being Debian/Ubuntu.

The BEGIN { @INC } block is another hack to mainly ensure that the "system" Cwd.pm is loaded, assuming "perlbrew" is executed by "system" perl. This way, when PERL5LIB contains some packages that are binary-incompatible with system perl, perlbrew can still work.

It surprises me that there are many issues around it that are effected by how different OS package perl.

@Grinnz

This comment has been minimized.

Copy link
Contributor

commented Jul 28, 2015

Any idea about a better solution for this? (It is still a problem for Fedora 22, and obviously RHEL7) I am fine manually editing the perlbrew script myself, but it is not very user-friendly.

gugod added a commit that referenced this issue Jul 28, 2015

@gugod

This comment has been minimized.

Copy link
Owner

commented Jul 28, 2015

The commit d38951b I just pushed modify the fatpacking script. The fatpacked perlbrew executable will be OK in future releases.

@Grinnz

This comment has been minimized.

Copy link
Contributor

commented Jul 28, 2015

Thank you for the update, but it isn't quite a complete solution for Fedora 22. (I don't have a RHEL7 system to test at the moment)

  1. for some reason, vendorlibexp (and vendorarchexp) must go at the end, or there is an error about Config_heavy.pl. I think it is that privlibexp must remain the first item.
  2. either vendorarch or vendorarchexp must also be included, otherwise File::Spec is not found.
@Grinnz

This comment has been minimized.

Copy link
Contributor

commented Jul 28, 2015

Sorry, I think I misinterpreted, this is to fatpack those modules into the script. So then it would just need to make sure that Getopt::Long and File::Spec and any other required modules in those directories end up fatpacked.

@sestaton

This comment has been minimized.

Copy link

commented Jul 28, 2015

I just tested on Fedora 22 and CentOS 7, and adding vendorlib and vendorarchexp to line 3 did the trick. @wumpus metioned this before, I don't know how I missed it or didn't get that right. If the self-upgrade pulls the latest fatpacked file then that command wouldn't work unless it includes these changes (I think). Thanks for the work on this. Edit: I meant to mention that adding vendorlibexp alone didn't seem to fix it for me (if I'm understanding the commit correctly).

@gugod

This comment has been minimized.

Copy link
Owner

commented Jul 28, 2015

FYI for those who are interested to do some pre-flight testing, I rebuild the fatpacked 'perlbrew' executable in develop branch:

https://raw.githubusercontent.com/gugod/App-perlbrew/develop/perlbrew

Just download and replace the current perlbrew executable (usually located under ~/perl5/perlbrew/bin)

@Grinnz

This comment has been minimized.

Copy link
Contributor

commented Jul 28, 2015

I tried it but I got the same Config_heavy.pl error as when I put vendorlibexp first in my local copy:

Can't locate Config_heavy.pl in @INC (@INC contains:) at /usr/lib64/perl5/Config.pm line 80.
BEGIN failed--compilation aborted at ./perlbrew.pl line 3.

I think that moving vendorlibexp to the end and adding vendorarchexp will also be required after all.

@sestaton

This comment has been minimized.

Copy link

commented Jul 28, 2015

I got the same error as above about Config_heavy.pl. If I fall back to what was in place previously and simply add the vendor libs we've been discussing, i.e.,

BEGIN { use Config; @INC = @Config{qw(privlibexp archlibexp sitelibexp sitearchexp vendorlib vendorarchexp)} };

It seems to install just fine. Hope that helps.

@malkowski

This comment has been minimized.

Copy link

commented Aug 12, 2015

Thought I'd throw in a couple more pennies to the discussion: I made the following changes to the perlbrew script to get things working in RHEL7:

BEGIN { use Config; @INC = @Config{qw( privlibexp archlibexp sitelibexp sitearchexp vendorlib vendorarchexp vendorlibexp )} };
@czarekplpl

This comment has been minimized.

Copy link

commented Oct 21, 2015

On Centos 7 I got the error in the last line:
perlbrew is installed: /perl5/perlbrew/bin/perlbrew
perlbrew root (
/perl5/perlbrew) is initialized.
Append the following piece of code to the end of your ~/.bash_profile and start a
new shell, perlbrew should be up and fully functional from there:
source ~/perl5/perlbrew/etc/bashrc
Simply run perlbrew for usage details.
Happy brewing!

ERROR: Failed to retrieve patchperl executable.

@dhoer

This comment has been minimized.

Copy link

commented Nov 10, 2015

+1
When will this patch will be added and released?

@davemenninger

This comment has been minimized.

Copy link

commented Nov 20, 2015

👍

@karenetheridge

This comment has been minimized.

Copy link
Contributor

commented Nov 24, 2015

@Grinnz

This comment has been minimized.

Copy link
Contributor

commented Nov 24, 2015

This version seems to solve the issue on Fedora 22.

@nnutter

This comment has been minimized.

Copy link

commented Nov 25, 2015

Worked on Fedora 23.

@wumpus

This comment has been minimized.

Copy link

commented Nov 25, 2015

Needs to also be tested in rhel/centos-5/6/7... glad to see this finally getting somewhere!

@Grinnz

This comment has been minimized.

Copy link
Contributor

commented Nov 26, 2015

I believe this was actually fixed (for the fatpack version) by this commit. 3dcb86d

@dhoer

This comment has been minimized.

Copy link

commented Nov 26, 2015

CentOS release 6.7 (Final) and CentOS Linux release 7.1.1503 (Core) worked. Thanks.

@gugod

This comment has been minimized.

Copy link
Owner

commented Nov 27, 2015

Thanks everyone for the feedback and fixes. Let's have some virtual beer together:

🍻 🍺 🍻 🍺 🍻 🍺 🍻 🍺

This was referenced Dec 15, 2015

jsonn pushed a commit to jsonn/pkgsrc that referenced this issue Apr 9, 2016

mef
Update 0.73 to 0.75
-------------------
0.75: # 2016-03-16T23:41:41+0100
- Thanks to our contributors: Dave Cross,  Dean Hamstead,  Mark J. Reed,  Mohammed El-Afifi,
- Add '--no-patchperl' install option for skip running patchperl.
- Add '--destdir' install option.
- "uninstall" command now also delete associated libs.
- "mirror" command is removed.
- "config" command is removed.

0.74: # 2015-11-24T20:55:02+0100
- A big thanks for our contributers: Aristotle Pagaltzis, Dave Jacoby,
  Dylan Cali, John Krull, Kevin Johnson, Nathan Day, Paul Cochrane, Tudor
  Constantin, Yanick Champoux, tm604
- support PERLBREW_LIB_PREFIX.
  gugod/App-perlbrew@c29813c
- prefer https and remove insecure download cli flags.
  gugod/App-perlbrew@f49a908
- perlbrew now dies when switching to/use a lib that does not exist.
  gugod/App-perlbrew#432
- RHEL vendorlib fix gugod/App-perlbrew#409
- improvements with fish integration.
- unbreak when running with perl 5.14 or earlier:
  "list" command now correctly display lib names.
- retaining flags in upgrade-perl.
  gugod/App-perlbrew@b8d4666
- variour document clean up and improvements.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.