SUMMARY if needrestart is installed, discover update never ends if an update requires a system restart (ie: a kernel update has been applied) STEPS TO REPRODUCE 1. install needrestart package 2. do an update in kde with discover while there is a kernel update pending OBSERVED RESULT discover updates system but the update never ends on discover EXPECTED RESULT discover update system, then says a restart is required and give back control SOFTWARE/OS VERSIONS Linux/KDE Plasma: (available in About System) KDE Plasma Version: 5.19.5 KDE Frameworks Version: 5.74.0 Qt Version: 5.14.2 ADDITIONAL INFORMATION the process hangs currently present : # pgrep -a -f need 1639236 sh -c test -x /usr/lib/needrestart/apt-pinvoke && /usr/lib/needrestart/apt-pinvoke || true 1639237 /usr/bin/perl /usr/sbin/needrestart # pstree -p 1639236 sh(1639236)───needrestart(1639237) # pstree -p 1639236 sh(1639236)───needrestart(1639237) # pstree 1639236 sh───needrestart # pstree -p 1639236 sh(1639236)───needrestart(1639237) # pstree -p 1639237 needrestart(1639237) # ps -ef | grep 1639236 root 1639236 1639226 0 15:55 pts/1 00:00:00 sh -c test -x /usr/lib/needrestart/apt-pinvoke && /usr/lib/needrestart/apt-pinvoke || true root 1639237 1639236 0 15:55 pts/1 00:00:00 /usr/bin/perl /usr/sbin/needrestart root 1640398 235137 0 16:06 pts/3 00:00:00 grep --color=auto 1639236 # ps -ef | grep 1639226 root 1639226 1638529 0 15:55 pts/1 00:00:00 /usr/lib/packagekit/packagekitd root 1639236 1639226 0 15:55 pts/1 00:00:00 sh -c test -x /usr/lib/needrestart/apt-pinvoke && /usr/lib/needrestart/apt-pinvoke || true root 1640448 235137 0 16:07 pts/3 00:00:00 grep --color=auto 1639226 # ps -ef | grep 1638529 root 1638529 1636890 0 15:55 pts/1 00:00:00 /usr/lib/packagekit/packagekitd root 1639226 1638529 0 15:55 pts/1 00:00:00 /usr/lib/packagekit/packagekitd root 1640474 235137 0 16:07 pts/3 00:00:00 grep --color=auto 1638529 # ps -ef | grep 1636890 root 1636890 1 1 15:54 ? 00:00:13 /usr/lib/packagekit/packagekitd root 1638529 1636890 0 15:55 pts/1 00:00:00 /usr/lib/packagekit/packagekitd root 1640478 235137 0 16:07 pts/3 00:00:00 grep --color=auto 1636890
Sounds like an issue in packagekit, can you please report it there? https://github.com/hughsie/PackageKit/issues Your assessment here will surely help devs figure it out.
I've taken a brief look and this really isn't a problem with packagekit but rather needrestart. It has a hook on apt from which it never returns as per the pgrep output: ` sh -c test -x /usr/lib/needrestart/apt-pinvoke && /usr/lib/needrestart/apt-pinvoke || true` is the hook, until it returns apt can't finish, and the reason it doesn't return is the needrestart process (gets exec'd by apt-pinvoke). The reason the update never ends is something inside needrestart that leads to needrestart never exiting -> blocking the hook -> blocking apt -> blocking packagekit -> blocking discover.
Oh boy, where does it need to be reported then?
https://github.com/liske/needrestart
Reported it there before it gets lost: https://github.com/liske/needrestart/issues/208