安裝nginx的時候,出現了這樣的問題:
nginx : Depends: libssl1.0.0 (>= 1.0.2~beta3) but 1.0.1f-1ubuntu2.11 is to be installed E: Unable to correct problems, you have held broken packages.
這個問題的原因是我們系統安裝的OpenSSL太老了。
查看OpenSSL的版本:
openssl version
得到的結果是:
OpenSSL 1.0.1f 6 Jan 2014
2014年的版本呢,去年(2015年)不是遇到了心在流血(heart breeding)的漏洞嗎?所以很有必要更新一下我們的OpenSSL了。
這里呢,我們采用的是從OpenSSL的官網下載,自己編譯的方法。因為目前還沒有找到Ubuntu新的軟件源使用更新的OpenSSL來解決問題的。
- 首先去OpenSSL的網站
- 在終端使用wget下載最新沒有漏洞的版本
- 解壓
tar xvf https://www.openssl.org/source/openssl-1.1.0c.tar.gz
- 配置並且安裝,這里假定我們在服務器上操作,已經獲取了root權限。
cd openssl-1.1.0c.tar.gz && configure && make -j4 && make install
- 由於安裝的位置默認是/usr/local/openssl,我們需要安裝到默認的位置上。即,通過設置軟鏈接以及其它的方式來解決問題。
ln -s /usr/local/bin/openssl /usr/bin/openssl
ln -s /usr/local/include/openssl /usr/include/openssl
echo "/usr/local/lib" >> /etc/ld.so.conf
- 最后鏈接應該沒有問題了。輸入
openssl version
應該輸出
OpenSSL 1.1.0c 10 Nov 2016
大功告成。
https://qtdream.com/topic/815/linux%E5%8D%87%E7%BA%A7openssl%E7%89%88%E6%9C%AC/2