美文网首页
ubuntu16.04重新安装nginx失败

ubuntu16.04重新安装nginx失败

作者: 探讨 | 来源:发表于2020-05-19 16:56 被阅读0次

前言:本文主要是记录阿里云服务器(Ubuntu16.04)nginx重新安装失败的问题

错误一

Failed to start A high performance web server and a reverse proxy server

有其他web服务器占用端口,检查80端口是否占用

lsof -i:80
COMMAND     PID USER   FD   TYPE  DEVICE SIZE/OFF NODE NAME
AliYunDun 10390 root   23u  IPv4 2664130      0t0  TCP xxx:xxx->xxx:http (ESTABLISHED)

如果出现上面的信息,则需要强制关闭进程

kill -9 10390 

错误二

dpkg: error processing package nginx-core (--configure):

出现此错误,估计是因为nginx安装依赖包nginx-core和nginx-common影响所致

查看nginx的依赖包

dpkg --get-selections | grep nginx
nginx                                           install
nginx-common                                    install
nginx-core                                      install

删除依赖包

apt-get remove nginx
apt-get --purge remove nginx(彻底卸载)
apt-get --purge remove nginx-core 
apt-get --purge remove nginx-common

或者自动删除依赖包,但是删除之后还是要再检查下依赖包是否删除完成

apt-get remove nginx
apt-get autoremove

安装

apt-get install nginx
systemctl start nginx
systemctl status nginx
wget http://localhost

相关文章

网友评论

      本文标题:ubuntu16.04重新安装nginx失败

      本文链接:https://www.haomeiwen.com/subject/hlgbohtx.html