Specifications[midas@localhost ~]$ uname -aLinux localhost.localdomain 4.0.4-301.fc22.x86_64 #1 SMP Thu May 21 13:10:33 UTC 2015 x86_64 x86_64 x86_64 GNU/Linuxand[midas@localhost ~]$ cat /etc/issueFedora release 22 (Twenty Two)Problem prefaceI was trying to install a new package through dnf on my Fedora 22. (Linux 4.0.4) When the package stopped downloading at 52% and the terminal window didn't show any more advancement.I aborted the download and attempted to restart it using the same dnf install [package name] command.I then received the following notification:Waiting for process with pid 2967 to finish.Turns out dnf was still running in the background:[midas@localhost ~]$ ps -A | grep 2967 2967 ?        00:00:01 dnfProblemI figured I could just kill the process, however:[midas@localhost ~]$ kill 2967bash: kill: (2967) - No such process[midas@localhost ~]$ sudo kill 2967kill: sending signal to 2967 failed: No such processHow come ps can list the process but kill can't find it?I know a reboot will solve this (or a bit of patience even). But I'm just curious as to why there is such a difference between these 2 commands.
ps finds process, kill doesn't
fedora;kill;ps;dnf
The listed process was probably already a zombie process, which you cannot kill.Its live-time is depending on its parent process.If you add the u flag to the call of ps, it displaysalso the STAT column which is Z for zombie processes.See e.g. https://stackoverflow.com/questions/16944886/how-to-kill-zombie-processfor more details.