nginx安裝失敗後重新安裝

ubuntu安裝nginx,由於80端口已經被佔用,sudo apt-get install nginx安裝一半異常退出,報錯誤:
dpkg: error processing package nginx (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
nginx-core
nginx
E: Sub-process /usr/bin/dpkg returned an error code (1)

再往上查詢會看到錯誤
nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)

修復辦法:
1.將80端口解綁,已佔用的程序改用其他端口,將提示的錯誤解決後

2.運行以下命令卸載一半的安裝:
sudo apt-get remove nginx*
sudo apt-get autoremove

  1. sudo apt-get install nginx即可重新安裝
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章