我无法在 Ubuntu 18.04 中安装 openssl。我按照以下步骤操作:
sudo apt install libssl-dev
sudo apt install libssl1.0-dev
wget https://www.openssl.org/source/openssl-1.1.1b.tar.gz
sudo mkdir /opt/openssl
sudo tar xfvz ~/Downloads/openssl-1.1.1b.tar.gz --directory /opt/openssl
perl --version
export LD_LIBRARY_PATH=/opt/openssl/lib
echo $LD_LIBRARY_PATH
cd /opt/openssl/openssl-1.1.1b
sudo ./config –prefix=/opt/openssl –openssldir=/opt/openssl/ssl
所有步骤均返回肯定消息,除最后一步外,返回以下内容:
Operating system: x86_64-whatever-linux2
Failure! build file wasn't produced.
Please read INSTALL and associated NOTES files. You may also have to look over
your available compiler tool chain or change your configuration.
target already defined - linux-x86_64 (offending arg: –prefix=/opt/openssl)
如果有人能帮忙,我将不胜感激。
答案1
对于我来说,如果我使用 --prefix 而不是 -prefix,它就可以正常工作,我之前遇到了同样的问题,请注意以下事项:
./config –prefix=/opt/OpenSSL –openssldir=/opt/OpenSSL 操作系统:x86_64-whatever-linux2
Failure! build file wasn't produced.
Please read INSTALL and associated NOTES files. You may also have to look over
your available compiler tool chain or change your configuration.
target already defined - linux-x86_64 (offending arg: –prefix=/opt/OpenSSL)
但是,使用:
./config -–prefix=/opt/OpenSSL/ -–openssldir=/opt/OpenSSL/
它运行良好并产生:
Operating system: x86_64-whatever-linux2
Configuring OpenSSL version 1.1.1c (0x1010103fL) for linux-x86_64
Using os-specific seed configuration
Creating configdata.pm
Creating Makefile
**********************************************************************
*** ***
*** OpenSSL has been successfully configured ***
*** ***
*** If you encounter a problem while building, please open an ***
*** issue on GitHub <https://github.com/openssl/openssl/issues> ***
*** and include the output from the following command: ***
*** ***
*** perl configdata.pm --dump ***
*** ***
*** (If you are new to OpenSSL, you might want to consult the ***
*** 'Troubleshooting' section in the INSTALL file first) ***
*** ***
**********************************************************************
我希望这有帮助