报错如下:
[root@localhost openssl-3.0.12]# ./config --prefix=/usr/local --openssldir=/usr/local/openssl
Can't locate IPC/Cmd.pm in @INC (@INC contains: /root/openssl-3.0.12/util/perl /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 . /root/openssl-3.0.12/external/perl/Text-Template-1.56/lib) at /root/openssl-3.0.12/util/perl/OpenSSL/config.pm line 19.
BEGIN failed--compilation aborted at /root/openssl-3.0.12/util/perl/OpenSSL/config.pm line 19.
Compilation failed in require at /root/openssl-3.0.12/Configure line 23.
BEGIN failed--compilation aborted at /root/openssl-3.0.12/Configure line 23.
解决办法如下:
1.安装perl-CPAN
yum install -y perl-CPAN
2.进入perl shell
perl -MCPAN -e shell
第一步选yes,第二步选manual,第三步选yes,如下:
[root@localhost openssl-3.0.12]# perl -MCPAN -e shell
CPAN.pm requires configuration, but most of it can be done automatically.
If you answer 'no' below, you will enter an interactive dialog for each
configuration option instead.
Would you like to configure as much as possible automatically? [yes] yes #第一次选择
Warning: You do not have write permission for Perl library directories.
To install modules, you need to configure a local Perl library directory or
escalate your privileges. CPAN can help you by bootstrapping the local::lib
module or by configuring itself to use 'sudo' (if available). You may also
resolve this problem manually if you need to customize your setup.
What approach do you want? (Choose 'local::lib', 'sudo' or 'manual')
[local::lib] manual #第二次选择
Autoconfigured everything but 'urllist'.
Now you need to choose your CPAN mirror sites. You can let me
pick mirrors for you, you can select them from a list or you
can enter them by hand.
Would you like me to automatically choose some CPAN mirror
sites for you? (This means connecting to the Internet) [yes] yes #第三次选择
Trying to fetch a mirror list from the Internet
Fetching with HTTP::Tiny:
http://www.perl.org/CPAN/MIRRORED.BY
Looking for CPAN mirrors near you (please be patient)
.. done!
New urllist
http://www.cpan.org/
Autoconfiguration complete.
commit: wrote '/root/.cpan/CPAN/MyConfig.pm'
You can re-run configuration any time with 'o conf init' in the CPAN shell
Terminal does not support AddHistory.
cpan shell -- CPAN exploration and modules installation (v1.9800)
Enter 'h' for help.
cpan[1]>
出现以下cpan[1]>就可以了。
3.安装缺少的模块
install IPC/Cmd.pm
后面就可以等着了,有点慢,耐心等待即可。