如何完全从Ubuntu 13.04中删除nginx?

16

我知道这个问题之前已经被问过了,我也看过它们,但是它们没有解决我的问题。

我执行了以下命令来从系统中删除nginx

sudo apt-get remove nginx

sudo apt-get purge nginx

尽管我进行了卸载,但执行nginx -V命令仍然返回以下结果...

nginx版本:nginx/1.4.1 编译器:gcc 4.7.3 (Ubuntu/Linaro 4.7.3-1ubuntu1) 启用TLS SNI支持 配置参数:--prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-mail --with-mail_ssl_module --with-file-aio --with-ipv6 --with-http_spdy_module

此外,ps aux | grep nginx也没有显示任何正在运行的nginx服务。

现在我不确定是否已经完全删除了nginx。如果没有,则如何删除?

dpkg -l | grep nginx的输出结果如下...

ii nginx-common 1.2.6-1ubuntu3 all small, powerful, scalable web/proxy server - common files
ii nginx-full 1.2.6-1ubuntu3 i386 nginx web/proxy server (standard version)

注:我是从源代码安装的。


4
需要移除/清除的软件包名称似乎是nginx-fullnginx-common,而不仅仅是nginx。 您可以使用dpkg -S $(which nginx)进行验证。 - twalberg
@twalberg 你说得没错。这对我有效。请将您的评论作为答案发布,我会将其标记为关闭。谢谢。 - ʞɹᴉʞ ǝʌɐp
1个回答

26

从您的dpkg -l输出可以看出,涉及到的软件包名称实际上是nginx-fullnginx-common,而不仅仅是简单的nginx。这些是需要被删除的软件包。

要找到包含特定程序(例如nginx)的软件包,您可以始终运行dpkg -S $(which nginx)


作为 dpkg -S $(which nginx) 的替代方案,可以使用 dpkg -l | grep nginx - ironicaldiction
@ironicaldiction 是的,你可以这样做,但这可能会列出多个软件包,而 dpkg -S $(which nginx) 将列出包含 nginx 程序的单个软件包... - twalberg
好的发现。只是在想你是否想要从你的系统中清除所有相关的文件。@twalberg - ironicaldiction

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接