Debian Codegraph @

upstream/mageia-cauldron/man1/cpan.1

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.45)
3 .\"
4 .\" Standard preamble:
5 .\" ========================================================================
6 .de Sp \" Vertical space (when we can't use .PP)
7 .if t .sp .5v
8 .if n .sp
9 ..
10 .de Vb \" Begin verbatim text
11 .ft CW
12 .nf
13 .ne \\$1
14 ..
15 .de Ve \" End verbatim text
16 .ft R
17 .fi
18 ..
19 .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
20 .ie n \{\
21 . ds C` ""
22 . ds C' ""
23 'br\}
24 .el\{\
25 . ds C`
26 . ds C'
27 'br\}
28 .\"
29 .\" Escape single quotes in literal strings from groff's Unicode transform.
30 .ie \n(.g .ds Aq \(aq
31 .el .ds Aq '
32 .\"
33 .\" If the F register is >0, we'll generate index entries on stderr for
34 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
35 .\" entries marked with X<> in POD. Of course, you'll have to process the
36 .\" output yourself in some meaningful fashion.
37 .\"
38 .\" Avoid warning from groff about undefined register 'F'.
39 .de IX
40 ..
41 .nr rF 0
42 .if \n(.g .if rF .nr rF 1
43 .if (\n(rF:(\n(.g==0)) \{\
44 . if \nF \{\
45 . de IX
46 . tm Index:\\$1\t\\n%\t"\\$2"
47 ..
48 . if !\nF==2 \{\
49 . nr % 0
50 . nr F 2
51 . \}
52 . \}
53 .\}
54 .rr rF
55 .\"
56 .\" Required to disable full justification in groff 1.23.0.
57 .if n .ds AD l
58 .\" ========================================================================
59 .\"
60 .IX Title "CPAN 1"
61 .TH CPAN 1 2026-05-26 "perl v5.42.0" "Perl Programmers Reference Guide"
62 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
63 .\" way too many mistakes in technical documents.
64 .if n .ad l
65 .nh
66 .SH NAME
67 cpan \- easily interact with CPAN from the command line
68 .SH SYNOPSIS
69 .IX Header "SYNOPSIS"
70 .Vb 2
71 \& # with arguments and no switches, installs specified modules
72 \& cpan module_name [ module_name ... ]
73 \&
74 \& # with switches, installs modules with extra behavior
75 \& cpan [\-cfFimtTw] module_name [ module_name ... ]
76 \&
77 \& # use local::lib
78 \& cpan \-I module_name [ module_name ... ]
79 \&
80 \& # one time mirror override for faster mirrors
81 \& cpan \-p ...
82 \&
83 \& # with just the dot, install from the distribution in the
84 \& # current directory
85 \& cpan .
86 \&
87 \& # without arguments, starts CPAN.pm shell
88 \& cpan
89 \&
90 \& # without arguments, but some switches
91 \& cpan [\-ahpruvACDLOPX]
92 .Ve
93 .SH DESCRIPTION
94 .IX Header "DESCRIPTION"
95 This script provides a command interface (not a shell) to CPAN. At the
96 moment it uses CPAN.pm to do the work, but it is not a one\-shot command
97 runner for CPAN.pm.
98 .SS Options
99 .IX Subsection "Options"
100 .IP \-a 4
101 .IX Item "-a"
102 Creates a CPAN.pm autobundle with CPAN::Shell\->autobundle.
103 .IP "\-A module [ module ... ]" 4
104 .IX Item "-A module [ module ... ]"
105 Shows the primary maintainers for the specified modules.
106 .IP "\-c module" 4
107 .IX Item "-c module"
108 Runs a \`make clean\` in the specified module\*(Aqs directories.
109 .IP "\-C module [ module ... ]" 4
110 .IX Item "-C module [ module ... ]"
111 Show the \fIChanges\fR files for the specified modules
112 .IP "\-D module [ module ... ]" 4
113 .IX Item "-D module [ module ... ]"
114 Show the module details. This prints one line for each out\-of\-date module
115 (meaning, modules locally installed but have newer versions on CPAN).
116 Each line has three columns: module name, local version, and CPAN
117 version.
118 .IP \-f 4
119 .IX Item "-f"
120 Force the specified action, when it normally would have failed. Use this
121 to install a module even if its tests fail. When you use this option,
122 \&\-i is not optional for installing a module when you need to force it:
123 .Sp
124 .Vb 1
125 \& % cpan \-f \-i Module::Foo
126 .Ve
127 .IP \-F 4
128 .IX Item "-F"
129 Turn off CPAN.pm\*(Aqs attempts to lock anything. You should be careful with
130 this since you might end up with multiple scripts trying to muck in the
131 same directory. This isn\*(Aqt so much of a concern if you\*(Aqre loading a special
132 config with \f(CW\*(C`\-j\*(C'\fR, and that config sets up its own work directories.
133 .IP "\-g module [ module ... ]" 4
134 .IX Item "-g module [ module ... ]"
135 Downloads to the current directory the latest distribution of the module.
136 .IP "\-G module [ module ... ]" 4
137 .IX Item "-G module [ module ... ]"
138 UNIMPLEMENTED
139 .Sp
140 Download to the current directory the latest distribution of the
141 modules, unpack each distribution, and create a git repository for each
142 distribution.
143 .Sp
144 If you want this feature, check out Yanick Champoux\*(Aqs \f(CW\*(C`Git::CPAN::Patch\*(C'\fR
145 distribution.
146 .IP \-h 4
147 .IX Item "-h"
148 Print a help message and exit. When you specify \f(CW\*(C`\-h\*(C'\fR, it ignores all
149 of the other options and arguments.
150 .IP "\-i module [ module ... ]" 4
151 .IX Item "-i module [ module ... ]"
152 Install the specified modules. With no other switches, this switch
153 is implied.
154 .IP \-I 4
155 .IX Item "-I"
156 Load \f(CW\*(C`local::lib\*(C'\fR (think like \f(CW\*(C`\-I\*(C'\fR for loading lib paths). Too bad
157 \&\f(CW\*(C`\-l\*(C'\fR was already taken.
158 .IP "\-j Config.pm" 4
159 .IX Item "-j Config.pm"
160 Load the file that has the CPAN configuration data. This should have the
161 same format as the standard \fICPAN/Config.pm\fR file, which defines
162 \&\f(CW$CPAN::Config\fR as an anonymous hash.
163 .IP \-J 4
164 .IX Item "-J"
165 Dump the configuration in the same format that CPAN.pm uses. This is useful
166 for checking the configuration as well as using the dump as a starting point
167 for a new, custom configuration.
168 .IP \-l 4
169 .IX Item "-l"
170 List all installed modules with their versions
171 .IP "\-L author [ author ... ]" 4
172 .IX Item "-L author [ author ... ]"
173 List the modules by the specified authors.
174 .IP \-m 4
175 .IX Item "-m"
176 Make the specified modules.
177 .IP "\-M mirror1,mirror2,..." 4
178 .IX Item "-M mirror1,mirror2,..."
179 A comma\-separated list of mirrors to use for just this run. The \f(CW\*(C`\-P\*(C'\fR
180 option can find them for you automatically.
181 .IP \-n 4
182 .IX Item "-n"
183 Do a dry run, but don\*(Aqt actually install anything. (unimplemented)
184 .IP \-O 4
185 .IX Item "-O"
186 Show the out\-of\-date modules.
187 .IP \-p 4
188 .IX Item "-p"
189 Ping the configured mirrors and print a report
190 .IP \-P 4
191 .IX Item "-P"
192 Find the best mirrors you could be using and use them for the current
193 session.
194 .IP \-r 4
195 .IX Item "-r"
196 Recompiles dynamically loaded modules with CPAN::Shell\->recompile.
197 .IP \-s 4
198 .IX Item "-s"
199 Drop in the CPAN.pm shell. This command does this automatically if you don\*(Aqt
200 specify any arguments.
201 .IP "\-t module [ module ... ]" 4
202 .IX Item "-t module [ module ... ]"
203 Run a \`make test\` on the specified modules.
204 .IP \-T 4
205 .IX Item "-T"
206 Do not test modules. Simply install them.
207 .IP \-u 4
208 .IX Item "-u"
209 Upgrade all installed modules. Blindly doing this can really break things,
210 so keep a backup.
211 .IP \-v 4
212 .IX Item "-v"
213 Print the script version and CPAN.pm version then exit.
214 .IP \-V 4
215 .IX Item "-V"
216 Print detailed information about the cpan client.
217 .IP \-w 4
218 .IX Item "-w"
219 UNIMPLEMENTED
220 .Sp
221 Turn on cpan warnings. This checks various things, like directory permissions,
222 and tells you about problems you might have.
223 .IP "\-x module [ module ... ]" 4
224 .IX Item "-x module [ module ... ]"
225 Find close matches to the named modules that you think you might have
226 mistyped. This requires the optional installation of Text::Levenshtein or
227 Text::Levenshtein::Damerau.
228 .IP \-X 4
229 .IX Item "-X"
230 Dump all the namespaces to standard output.
231 .SS Examples
232 .IX Subsection "Examples"
233 .Vb 2
234 \& # print a help message
235 \& cpan \-h
236 \&
237 \& # print the version numbers
238 \& cpan \-v
239 \&
240 \& # create an autobundle
241 \& cpan \-a
242 \&
243 \& # recompile modules
244 \& cpan \-r
245 \&
246 \& # upgrade all installed modules
247 \& cpan \-u
248 \&
249 \& # install modules ( sole \-i is optional )
250 \& cpan \-i Netscape::Booksmarks Business::ISBN
251 \&
252 \& # force install modules ( must use \-i )
253 \& cpan \-fi CGI::Minimal URI
254 \&
255 \& # install modules but without testing them
256 \& cpan \-Ti CGI::Minimal URI
257 .Ve
258 .SS "Environment variables"
259 .IX Subsection "Environment variables"
260 There are several components in CPAN.pm that use environment variables.
261 The build tools, ExtUtils::MakeMaker and Module::Build use some,
262 while others matter to the levels above them. Some of these are specified
263 by the Perl Toolchain Gang:
264 .PP
265 Lancaster Consensus: <https://github.com/Perl\-Toolchain\-Gang/toolchain\-site/blob/master/lancaster\-consensus.md>
266 .PP
267 Oslo Consensus: <https://github.com/Perl\-Toolchain\-Gang/toolchain\-site/blob/master/oslo\-consensus.md>
268 .IP NONINTERACTIVE_TESTING 4
269 .IX Item "NONINTERACTIVE_TESTING"
270 Assume no one is paying attention and skips prompts for distributions
271 that do that correctly. \f(CWcpan(1)\fR sets this to \f(CW1\fR unless it already
272 has a value (even if that value is false).
273 .IP PERL_MM_USE_DEFAULT 4
274 .IX Item "PERL_MM_USE_DEFAULT"
275 Use the default answer for a prompted questions. \f(CWcpan(1)\fR sets this
276 to \f(CW1\fR unless it already has a value (even if that value is false).
277 .IP CPAN_OPTS 4
278 .IX Item "CPAN_OPTS"
279 As with \f(CW\*(C`PERL5OPT\*(C'\fR, a string of additional \f(CWcpan(1)\fR options to
280 add to those you specify on the command line.
281 .IP CPANSCRIPT_LOGLEVEL 4
282 .IX Item "CPANSCRIPT_LOGLEVEL"
283 The log level to use, with either the embedded, minimal logger or
284 Log::Log4perl if it is installed. Possible values are the same as
285 the \f(CW\*(C`Log::Log4perl\*(C'\fR levels: \f(CW\*(C`TRACE\*(C'\fR, \f(CW\*(C`DEBUG\*(C'\fR, \f(CW\*(C`INFO\*(C'\fR, \f(CW\*(C`WARN\*(C'\fR,
286 \&\f(CW\*(C`ERROR\*(C'\fR, and \f(CW\*(C`FATAL\*(C'\fR. The default is \f(CW\*(C`INFO\*(C'\fR.
287 .IP GIT_COMMAND 4
288 .IX Item "GIT_COMMAND"
289 The path to the \f(CW\*(C`git\*(C'\fR binary to use for the Git features. The default
290 is \f(CW\*(C`/usr/local/bin/git\*(C'\fR.
291 .SH "EXIT VALUES"
292 .IX Header "EXIT VALUES"
293 The script exits with zero if it thinks that everything worked, or a
294 positive number if it thinks that something failed. Note, however, that
295 in some cases it has to divine a failure by the output of things it does
296 not control. For now, the exit codes are vague:
297 .PP
298 .Vb 1
299 \& 1 An unknown error
300 \&
301 \& 2 The was an external problem
302 \&
303 \& 4 There was an internal problem with the script
304 \&
305 \& 8 A module failed to install
306 .Ve
307 .SH "TO DO"
308 .IX Header "TO DO"
309 * one shot configuration values from the command line
310 .SH BUGS
311 .IX Header "BUGS"
312 * none noted
313 .SH "SEE ALSO"
314 .IX Header "SEE ALSO"
315 Most behaviour, including environment variables and configuration,
316 comes directly from CPAN.pm.
317 .SH "SOURCE AVAILABILITY"
318 .IX Header "SOURCE AVAILABILITY"
319 This code is in Github in the CPAN.pm repository:
320 .PP
321 .Vb 1
322 \& https://github.com/andk/cpanpm
323 .Ve
324 .PP
325 The source used to be tracked separately in another GitHub repo,
326 but the canonical source is now in the above repo.
327 .SH CREDITS
328 .IX Header "CREDITS"
329 Japheth Cleaver added the bits to allow a forced install (\-f).
330 .PP
331 Jim Brandt suggest and provided the initial implementation for the
332 up\-to\-date and Changes features.
333 .PP
334 Adam Kennedy pointed out that \fBexit()\fR causes problems on Windows
335 where this script ends up with a .bat extension
336 .SH AUTHOR
337 .IX Header "AUTHOR"
338 brian d foy, \f(CW\*(C`<[email protected]>\*(C'\fR
339 .SH COPYRIGHT
340 .IX Header "COPYRIGHT"
341 Copyright (c) 2001\-2015, brian d foy, All Rights Reserved.
342 .PP
343 You may redistribute this under the same terms as Perl itself.