编译OpenSSL时报错,Can‘t locate IPC/Cmd.pm in @INC

环境:

操作系统:CentOS 7.4,perl版本:v5.16.3

编译OpenSSL 3.0.1时报错,错误信息如下

[root@centos7 openssl-3.0.1]# ./config --help
Can't locate IPC/Cmd.pm in @INC (@INC contains: /root/Downloads/openssl-3.0.1/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/Downloads/openssl-3.0.1/external/perl/Text-Template-1.56/lib) at /root/Downloads/openssl-3.0.1/util/perl/OpenSSL/config.pm line 18.
BEGIN failed--compilation aborted at /root/Downloads/openssl-3.0.1/util/perl/OpenSSL/config.pm line 18.
Compilation failed in require at /root/Downloads/openssl-3.0.1/Configure line 23.
BEGIN failed--compilation aborted at /root/Downloads/openssl-3.0.1/Configure line 23.

报错原因:缺少IPC/Cmd.pm模块

解决方法:

安装perl-CPAN

[root@centos7 ~]# yum install -y perl-CPAN

进入CPAN的shell模式,首次进入需要配置shell,按照提示操作即可(本人perl小白,全部选择默认配置,高手请根据提示自行选择)

[root@centos7 ~]# perl -MCPAN -e shell

在shell中安装缺少的模块

cpan[1]> install IPC/Cmd.pm

退出

cpan[1]>quit

安装成功后,重新编译OpenSSL即可

posted @ 2022-06-07 16:07  HikL[爱心]  阅读(1474)  评论(0)    收藏  举报