1. 程式人生 > 其它 >編譯OpenSSL時報錯,Can‘t locate IPC/Cmd.pm in @INC

編譯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
安裝成功後,重新編譯OpenSSL即可
————————————————
版權宣告:本文為CSDN博主「Sunlight_Rain_」的原創文章,遵循CC 4.0 BY-SA版權協議,轉載請附上原文出處連結及本宣告。
原文連結:https://blog.csdn.net/sd4493091/article/details/122220902