由于想要安裝最新版本的openssl徘键,并沒(méi)有使用ubuntu的apt指令即sudo apt install openssl安裝嘁灯。
首先震鹉,從openssl官網(wǎng)下載自己想要安裝的版本吩抓,官網(wǎng)鏈接:/index.html
我下載的是OpenSSL 1.0.2o版本群井,
1. 壓縮包解壓
sudo tar -zxvf openssl-1.0.2o.tar.gz
獲得文件openssl-1.0.2o
2. cd openssl-1.0.2o
3. 先看一下里面的README奥耆L薄!很重要@奚贰混弥!
其中,關(guān)于安裝openssl的安裝指南对省,說(shuō)明了:
See the appropriate file:
INSTALL Linux, Unix, etc.
INSTALL.DJGPP DOS platform with DJGPP
INSTALL.NW Netware
INSTALL.OS2 OS/2
INSTALL.VMS VMS
INSTALL.W32 Windows (32bit)
INSTALL.W64 Windows (64bit)
INSTALL.WCE Windows CE
我是在ubuntu上面安裝蝗拿,因此,我看INSTALL這個(gè)文件
4. 在INSTALL文件中蒿涎,給出了兩種安裝方式哀托,
(1)第一種:
If you want to just get on with it, do:
$ ./config
$ make
$ make test
$ make install
我按照此方法安裝完之后,輸入openssl version,劳秋,仍然顯示我沒(méi)有安裝仓手。我目前還不知道為什么會(huì)這樣。所以這種方法并未最終采用
(2)第二種方法玻淑,也是我安裝成功的方法:
$ ./config --prefix=/usr/local --openssldir=/usr/local/openssl 備注:指定了openssl的安裝路徑
$ make
$ make test
$ make install
安裝完成后嗽冒,輸入openssl version,顯示OpenSSL 1.0.2o 27 Mar 2018
輸入which openssl岁忘,顯示/usr/local/bin/openssl
終于辛慰!安裝成功了!我之前l(fā)ocate openssl干像,find openssl, sudo apt-get purge openssl等功夫以后可以省了帅腌。。麻汰。