清除 nginx 后是否完全自动删除 nginx 残余?

清除 nginx 后是否完全自动删除 nginx 残余?

当我使用这个

apt-get --purge remove nginx
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  nginx-common nginx-full
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  nginx*
0 upgraded, 0 newly installed, 1 to remove and 23 not upgraded.
After this operation, 101 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 213649 files and directories currently installed.)
Removing nginx (1.6.2-5) ...
root@pengsir:/home/debian8# dpkg -l nginx
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=================================
un  nginx          <none>       <none>       (no description available)

我还发现了一些剩菜:

# find / -name 'nginx'
/usr/sbin/nginx
/usr/share/nginx
/etc/nginx
/etc/ufw/applications.d/nginx
/etc/logrotate.d/nginx
/etc/init.d/nginx
/etc/default/nginx
/var/lib/nginx
/var/log/nginx

然后

apt-get autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  nginx-common nginx-full
0 upgraded, 0 newly installed, 2 to remove and 23 not upgraded.
After this operation, 1,339 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 213645 files and directories currently installed.)
Removing nginx-full (1.6.2-5) ...
Removing nginx-common (1.6.2-5) ...
Processing triggers for man-db (2.7.0.2-5) ...

仍然:

# find / -name 'nginx'
/etc/nginx
/etc/ufw/applications.d/nginx
/etc/logrotate.d/nginx
/etc/init.d/nginx
/etc/default/nginx
/var/log/nginx

/usr/sbin/nginx ...等文件都与nginx有关。我认为nginx根本没有被彻底删除。

当我们说 时completely uninstall package_name,是否意味着删除与 package_name 相关的所有配置文件?
如何有效地使用某些命令删除所有文件?

请不要告诉与做什么find / -name 'nginx' | rm -rf.....

答案1

autoremove命令默认不会清除可自动移除的软件包。为此,请使用

apt-get autoremove --purge 

相关内容