App-cpanminus
view release on metacpan or search on metacpan
lib/App/cpanminus.pm view on Meta::CPAN
=head1 DESCRIPTION
cpanminus is a script to get, unpack, build and install modules from
CPAN and does nothing else.
It's dependency free (can bootstrap itself), requires zero
configuration, and stands alone. When running, it requires only 10MB
of RAM.
=head1 INSTALLATION
There are several ways to install cpanminus to your system.
=head2 Package management system
There are Debian packages, RPMs, FreeBSD ports, and packages for other
operation systems available. If you want to use the package management system,
search for cpanminus and use the appropriate command to install. This makes it
easy to install C<cpanm> to your system without thinking about where to
install, and later upgrade.
=head2 Installing to system perl
You can also use the latest cpanminus to install cpanminus itself:
curl -L https://cpanmin.us | perl - --sudo App::cpanminus
This will install C<cpanm> to your bin directory like
C</usr/local/bin> and you'll need the C<--sudo> option to write to
the directory, unless you configured C<INSTALL_BASE> with L<local::lib>.
=head2 Installing to local perl (perlbrew, plenv etc.)
If you have perl in your home directory, which is the case if you use
tools like L<perlbrew> or plenv, you don't need the C<--sudo> option, since
you're most likely to have a write permission to the perl's library
path. You can just do:
curl -L https://cpanmin.us | perl - App::cpanminus
to install the C<cpanm> executable to the perl's bin path, like
C<~/perl5/perlbrew/bin/cpanm>.
=head2 Downloading the standalone executable
You can also copy the standalone executable to whatever location you'd like.
cd ~/bin
curl -L https://cpanmin.us/ -o cpanm
chmod +x cpanm
This just works, but be sure to grab the new version manually when you
upgrade because C<--self-upgrade> might not work with this installation setup.
=head2 Troubleshoot: HTTPS warnings
When you run C<curl> commands above, you may encounter SSL handshake
errors or certification warnings. This is due to your HTTP client
(curl) being old, or SSL certificates installed on your system needs
to be updated.
You're recommended to update the software or system if you can. If
that is impossible or difficult, use the C<-k> option with curl.
=head1 DEPENDENCIES
perl 5.8.1 or later.
=over 4
=item *
'tar' executable (bsdtar or GNU tar version 1.22 are recommended) or Archive::Tar to unpack files.
=item *
C compiler, if you want to build XS modules.
=item *
make
=item *
Module::Build (core in 5.10)
=back
=head1 QUESTIONS
=head2 How does cpanm get/parse/update the CPAN index?
It queries the CPAN Meta DB site at L<http://cpanmetadb.plackperl.org/>.
The site is updated at least every hour to reflect the latest changes
from fast syncing mirrors. The script then also falls back to query the
module at L<http://metacpan.org/> using its search API.
Upon calling these API hosts, cpanm (1.6004 or later) will send the
local perl versions to the server in User-Agent string by default. You
can turn it off with C<--no-report-perl-version> option. Read more
about the option with L<cpanm>, and read more about the privacy policy
about this data collection at L<http://cpanmetadb.plackperl.org/#privacy>
Fetched files are unpacked in C<~/.cpanm> and automatically cleaned up
periodically. You can configure the location of this with the
C<PERL_CPANM_HOME> environment variable.
=head2 Where does this install modules to? Do I need root access?
It installs to wherever ExtUtils::MakeMaker and Module::Build are
configured to (via C<PERL_MM_OPT> and C<PERL_MB_OPT>).
By default, it installs to the site_perl directory that belongs to
your perl. You can see the locations for that by running C<perl -V>
and it will be likely something under C</opt/local/perl/...> if you're
using system perl, or under your home directory if you have built perl
yourself using perlbrew or plenv.
If you've already configured local::lib on your shell, cpanm respects
that settings and modules will be installed to your local perl5
directory.
At a boot time, cpanminus checks whether you have already configured
local::lib, or have a permission to install modules to the site_perl
directory. If neither, i.e. you're using system perl and do not run
cpanm as a root, it automatically sets up local::lib compatible
installation path in a C<perl5> directory under your home
directory.
To avoid this, run C<cpanm> either as a root user, with C<--sudo>
option, or with C<--local-lib> option.
=head2 cpanminus can't install the module XYZ. Is it a bug?
It is more likely a problem with the distribution itself. cpanminus
doesn't support or may have issues with distributions such as follows:
=over 4
=item *
Tests that require input from STDIN.
=item *
Build.PL or Makefile.PL that prompts for input even when
C<PERL_MM_USE_DEFAULT> is enabled.
=item *
Modules that have invalid numeric values as VERSION (such as C<1.1a>)
=back
( run in 0.931 second using v1.01-cache-2.11-cpan-22024b96cdf )