Comment 2 for bug 1502438

Revision history for this message
陈伟琪 (gameboy709494-d) wrote :

I try uninstall it harder, and I fond something odd:

(I reinstalled avahi-daemon and rebooted )
(After I rebooted my pc successfully, I did "sudo systemctl stop avahi-daemon.service avahi-daemon.socket"), and then

chen@MSI-Ubuntu:~$ sudo apt-get purge avahi-daemon
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
下列软件包将被【卸载】:
  avahi-daemon* libnss-mdns*
升级了 0 个软件包,新安装了 0 个软件包,要卸载 2 个软件包,有 0 个软件包未被升级。
解压缩后将会空出 501 kB 的空间。
您希望继续执行吗? [Y/n] y
(正在读取数据库 ... 系统当前共安装有 339528 个文件和目录。)
正在卸载 libnss-mdns:amd64 (0.10-6) ...
libnss-mdns.postrm: Checking NSS setup...
libnss-mdns.postrm: Removing mdns from NSS setup
正在清除 libnss-mdns:amd64 (0.10-6) 的配置文件 ...
正在卸载 avahi-daemon (0.6.31-4ubuntu4) ...
Warning: Stopping avahi-daemon.service, but it can still be activated by:
  avahi-daemon.socket
正在清除 avahi-daemon (0.6.31-4ubuntu4) 的配置文件 ...
userdel: user avahi is currently used by process 3300
/usr/sbin/deluser:"/usr/sbin/userdel avahi"返回错误代码 8,退出。
/usr/sbin/delgroup: "avahi"仍以"avahi"作为他们的首选组!
rmdir: 删除 "/var/run/avahi-daemon" 失败: 目录非空
正在处理用于 libc-bin (2.21-0ubuntu4) 的触发器 ...
正在处理用于 dbus (1.8.12-1ubuntu5) 的触发器 ...
正在处理用于 man-db (2.7.0.2-5) 的触发器 ...
chen@MSI-Ubuntu:~$ cat /var/run/avahi-daemon/
cat: /var/run/avahi-daemon/: 权限不够
chen@MSI-Ubuntu:~$ sudo cat /var/run/avahi-daemon/*
cat: /var/run/avahi-daemon/*: 没有那个文件或目录
chen@MSI-Ubuntu:~$ cd /var/run
chen@MSI-Ubuntu:/var/run$ cd avahi-daemon/
bash: cd: avahi-daemon/: 权限不够
chen@MSI-Ubuntu:/var/run$ sudo su
root@MSI-Ubuntu:/run# cd avahi-daemon/
root@MSI-Ubuntu:/run/avahi-daemon# ls
pid socket
root@MSI-Ubuntu:/run/avahi-daemon# cat pid
3299
root@MSI-Ubuntu:/run/avahi-daemon#

The pid file on /run/avahi-daemon value is 3299 ,

and

root@MSI-Ubuntu:/run/avahi-daemon# ps -aux | grep avahi
avahi 3299 0.0 0.0 30312 3164 ? Ss 21:26 0:00 avahi-daemon: running [MSI-Ubuntu.local]
avahi 3300 0.0 0.0 30188 240 ? S 21:26 0:00 avahi-daemon: chroot helper
root 4340 0.0 0.0 11192 2336 pts/0 S+ 21:35 0:00 grep --color=auto avahi

So I may think the command "sudo systemctl stop avahi-daemon.service avahi-daemon.socket" not work.
Because It not kill the avahi-daemon process, So I can't remove the package avahi-daemon.