由于本人把自己服务器的nginx 给玩坏了,不得已选择卸载重新安装,(先让我哭一会)
然后我把/usr/sbin/nginx 和/etc/nginx 和/usr/share/nginx 和 /usr/share/man/man1/nginx.1.gz的文件夹给删了
然后去重新装 执行这个命令:apt-get install nginx
发现老是报:
nginx is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 14 not upgraded.
大概意思就是nginx已经存在还是没有删除掉。可能存在了一些配置什么东西的,反正我们是没有把nginx删干净
然后我又去网上找了好多资料,他们大多数都是说 把那几个文件夹删了 就可以,
然而对于我来说 并没有卵用。好吧!继续在网上早解决的办法,找到一个我试一个。然后就找到下面的方法了:
rm -rf /etc/nginx
rm -rf /usr/sbin/nginx
rm /usr/share/man/man1/nginx.1.gz
apt-get remove nginx* (apt-get remove --purge nginx)
sudo apt-get remove nginx #Removes all but config files.
sudo apt-get purge nginx #Removes everything.
参考资料:http://articles.slicehost.com/2007/12/3/ubuntu-gutsy-installing-nginx-from-source
重新安装:
To recreate it, first uninstall using purge to remove even configuration files and records:
apt-get purge nginx nginx-common nginx-full
then reinstall:
apt-get install nginx
if above doesn‘t work for you
You can also try using --force-confmiss option of dpkg.
sudo dpkg --force-confmiss -i /var/cache/apt/archives/nginx-common_*.deb
参考资料:http://stackoverflow.com/questions/12362967/how-can-i-restore-etc-nginx
我的问题就是按照上面的解决了, 感谢万能的网络