OS Manuals

/usr/bin/cpanm

Get, unpack, build and install modules from CPAN

From perl-app-cpanminus 1.7049-r5 (os), captured 2026-11-05 by running cpanm --help (exit 0). permalink

Usage: cpanm [options] Module [...]

Options:
  -v,--verbose              Turns on chatty output
  -q,--quiet                Turns off the most output
  --interactive             Turns on interactive configure (required for Task:: modules)
  -f,--force                force install
  -n,--notest               Do not run unit tests
  --test-only               Run tests only, do not install
  -S,--sudo                 sudo to run install commands
  --installdeps             Only install dependencies
  --showdeps                Only display direct dependencies
  --reinstall               Reinstall the distribution even if you already have the latest version installed
  --mirror                  Specify the base URL for the mirror (e.g. http://cpan.cpantesters.org/)
  --mirror-only             Use the mirror's index file instead of the CPAN Meta DB
  -M,--from                 Use only this mirror base URL and its index file
  --prompt                  Prompt when configure/build/test fails
  -l,--local-lib            Specify the install base to install modules
  -L,--local-lib-contained  Specify the install base to install all non-core modules
  --self-contained          Install all non-core modules, even if they're already installed.
  --auto-cleanup            Number of days that cpanm's work directories expire in. Defaults to 7

Commands:
  --self-upgrade            upgrades itself
  --info                    Displays distribution info on CPAN
  --look                    Opens the distribution with your SHELL
  -U,--uninstall            Uninstalls the modules (EXPERIMENTAL)
  -V,--version              Displays software version

Examples:

  cpanm Test::More                                          # install Test::More
  cpanm MIYAGAWA/Plack-0.99_05.tar.gz                       # full distribution path
  cpanm http://example.org/LDS/CGI.pm-3.20.tar.gz           # install from URL
  cpanm ~/dists/MyCompany-Enterprise-1.00.tar.gz            # install from a local file
  cpanm --interactive Task::Kensho                          # Configure interactively
  cpanm .                                                   # install from local directory
  cpanm --installdeps .                                     # install all the deps for the current directory
  cpanm -L extlib Plack                                     # install Plack and all non-core deps into extlib
  cpanm --mirror http://cpan.cpantesters.org/ DBI           # use the fast-syncing mirror
  cpanm -M https://cpan.metacpan.org App::perlbrew          # use only this secure mirror and its index

You can also specify the default options in PERL_CPANM_OPT environment variable in the shell rc:

  export PERL_CPANM_OPT="--prompt --reinstall -l ~/perl --mirror http://cpan.cpantesters.org"

Type `man cpanm` or `perldoc cpanm` for the more detailed explanation of the options.
Options (49)
OptionDescriptionSource
-v, --verboseMakes the output verbose.help + man
-q, --quietMakes the output even more quiet than the default.help + man
--interactiveMakes the configuration (such as "Makefile.PL" and "Build.PL") interactive, so you can answer questions in the distribution that requires custom configuration or Task:: distributions.help + man
-f, --forceForce install modules even when testing failed.help + man
-n, --notestSkip the testing of modules.help + man
--test-onlyRun the tests only, and do not install the specified module or distributions.help + man
-S, --sudoSwitch to the root user with "sudo" when installing modules.help + man
--installdepsOnly install dependencieshelp
--showdepsOnly display direct dependencieshelp
--reinstallcpanm, when given a module name in the command line (i.e. "cpanm Plack"), checks the locally installed version first and skips if it is already installed.help + man
--mirrorSpecifies the base URL for the CPAN mirror to use, such as "http://cpan.cpantesters.org/" (you can omit the trailing slash).help + man
--mirror-onlyDownload the mirror's 02packages.details.txt.gz index file instead of querying the CPAN Meta DB.help + man
-M, --fromUse only this mirror base URL and its index filehelp + man
--promptPrompts when a test fails so that you can skip, force install, retry or look in the shell to see what's going wrong.help + man
-l, --local-libSets the local::lib compatible path to install modules to.help + man
-L, --local-lib-containedSpecify the install base to install all non-core moduleshelp + man
--self-containedWhen examining the dependencies, assume no non-core modules are installed on the system.help + man
--auto-cleanupSpecifies the number of days in which cpanm's work directories expire.help + man
--self-upgradeupgrades itselfhelp
--infoDisplays distribution info on CPANhelp
--lookOpens the distribution with your SHELLhelp
-U, --uninstallUninstalls a module from the library path.help + man
-V, --versionDisplays software versionhelp
--exclude-vendorDon't include modules installed under the 'vendor' paths when searching for core modules when the "--self-contained" flag is in effect. (in the manual page but not in --help)man
--mirror-indexEXPERIMENTAL: Specifies the file path to "02packages.details.txt" for module search index. (in the manual page but not in --help)man
--cpanmetadbEXPERIMENTAL: Specifies an alternate URI for CPAN MetaDB index lookups. (in the manual page but not in --help)man
--metacpanPrefers MetaCPAN API over CPAN MetaDB. (in the manual page but not in --help)man
--cpanfileEXPERIMENTAL: Specified an alternate path for cpanfile to search for, when "--installdeps" command is in use. (in the manual page but not in --help)man
--devEXPERIMENTAL: search for a newer developer release as well. (in the manual page but not in --help)man
--pp, --pureperlPrefer Pure perl build of modules by setting "PUREPERL_ONLY=1" for MakeMaker and "--pureperl-only" for Build.PL based distributions. (in the manual page but not in --help)man
--with-recommends, --with-suggestsEXPERIMENTAL: Installs dependencies declared as "recommends" and "suggests" respectively, per META spec. (in the manual page but not in --help)man
--with-developEXPERIMENTAL: Installs develop phase dependencies in META files or "cpanfile" when used with "--installdeps". (in the manual page but not in --help)man
--with-configureEXPERIMENTAL: Installs configure phase dependencies in "cpanfile" when used with "--installdeps". (in the manual page but not in --help)man
--with-feature, --without-feature, --with-all-featuresEXPERIMENTAL: Specifies the feature to enable, if a module supports optional features per META spec 2.0. (in the manual page but not in --help)man
--configure-timeout, --build-timeout, --test-timeoutSpecify the timeout length (in seconds) to wait for the configure, build and test process. (in the manual page but not in --help)man
--configure-args, --build-args, --test-args, --install-argsEXPERIMENTAL: Pass arguments for configure/build/test/install commands respectively, for a given module to install. (in the manual page but not in --help)man
--scandepsDEPRECATED: Scans the depencencies of given modules and output the tree in a text format. (in the manual page but not in --help)man
--formatDEPRECATED: Determines what format to display the scanned dependency tree. (in the manual page but not in --help)man
--save-distsSpecifies the optional directory path to copy downloaded tarballs in the CPAN mirror compatible directory structure i.e. authors/id/A/AU/AUTHORS/Foo-Bar-version.tar.gz (in the manual page but not in --help)man
--uninst-shadowsUninstalls the shadow files of the distribution that you're installing. (in the manual page but not in --help)man
--cascade-searchEXPERIMENTAL: Specifies whether to cascade search when you specify multiple mirrors and a mirror doesn't have a module or has a lower version of the module than requested. (in the manual page but not in --help)man
--skip-installedSpecifies whether a module given in the command line is skipped if its latest version is already installed. (in the manual page but not in --help)man
--skip-satisfiedEXPERIMENTAL: Specifies whether a module (and version) given in the command line is skipped if it's already installed. (in the manual page but not in --help)man
--verifyVerify the integrity of distribution files retrieved from CPAN using CHECKSUMS file, and SIGNATURES file (if found in the distribution). (in the manual page but not in --help)man
--report-perl-versionWhether it reports the locally installed perl version to the various web server as part of User-Agent. (in the manual page but not in --help)man
--man-pagesGenerates man pages for executables (man1) and libraries (man3). (in the manual page but not in --help)man
--lwpUses LWP module to download stuff over HTTP. (in the manual page but not in --help)man
--wgetUses GNU Wget (if available) to download stuff. (in the manual page but not in --help)man
--curlUses cURL (if available) to download stuff. (in the manual page but not in --help)man

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.