Skip to content

Instantly share code, notes, and snippets.

@soardex
Created July 11, 2015 15:31
Show Gist options
  • Save soardex/5474b5cf3f263d6acd77 to your computer and use it in GitHub Desktop.
Save soardex/5474b5cf3f263d6acd77 to your computer and use it in GitHub Desktop.
Perlbrew on CentOS 7
# install perlbrew
sudo yum install -y perl perl-CPAN perl-CPAN-Meta
sudo cpan App::cpanminus
sudo cpanm install App::perlbrew
# install cpanm and perl latest
perlbrew install-cpanm
perlbrew install-patchperl
perlbrew install 5.22.0
# change the perl5 perlbrew directory
export PERLBREW_ROOT=/opt/perl5
# set the default perl and to switch perlbrew on
perlbrew switch perl-5.22.0
# temporary use another version of perl on the current shell
perlbrew use perl-5.22.0
# turnoff perlbrew completely and use system default perl
perlbrew off
@mfcovington
Copy link

For people that get an error (sudo: cpanm: command not found) when running sudo cpanm install App::perlbrew, try this:

cpanm --sudo install App::perlbrew

@marcelser
Copy link

Doesn't really work for me as the installed perl modules on CentOS7 are too old to actually support perlbrew. I get 2 modules failing with too old versions "Pod::Parser" and "File::Which". The stupid thing is that for Pod::Parser it claims to have installed 1.63 but obviously Pod::Parser still reports 1.61 after installation, see this log output:

$ cpanm --sudo install App::perlbrew
install is up to date. (0.01)
--> Working on App::perlbrew
Fetching http://www.cpan.org/authors/id/G/GU/GUGOD/App-perlbrew-0.82.tar.gz ... OK
Configuring App-perlbrew-0.82 ... OK
==> Found dependencies: File::Which, Pod::Parser
--> Working on File::Which
Fetching http://www.cpan.org/authors/id/P/PL/PLICEASE/File-Which-1.22.tar.gz ... OK
Configuring File-Which-1.22 ... OK
Building and testing File-Which-1.22 ... FAIL
! Installing File::Which failed. See /home/vagrant/.cpanm/work/1525276279.27177/build.log for details. Retry with --force to force install it.
--> Working on Pod::Parser
Fetching http://www.cpan.org/authors/id/M/MA/MAREKR/Pod-Parser-1.63.tar.gz ... OK
Configuring Pod-Parser-1.63 ... OK
Building and testing Pod-Parser-1.63 ... OK
Successfully installed Pod-Parser-1.63 (upgraded from 1.61)
! Installing the dependencies failed: Installed version (1.09) of File::Which is not in range '1.21', Installed version (1.61) of Pod::Parser is not in range '1.63'
! Bailing out the installation for App-perlbrew-0.82.
1 distribution installed

@delgreco
Copy link

delgreco commented Mar 2, 2019

I'm getting the same from Pod::Parser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment