Potentially helpful issue details:
On my LMDE 5(?), behaviour of the needrestart package will cause annoying lockups / hangs on each apt activity.
I diagnosed this via
# needrestart -v
which reported
[/etc/needrestart/notify.d/400-notify-send] notify user [USERNAME] on :0
The /etc/needrestart/notify.d/400-notify-send script
uses
NSEND='/usr/bin/notify-send'
Doing
/usr/bin/notify-send SomeText
as plain user does work (clickable notification popup successfully displayed), but as apt installation context (administrative user) does not work (long hang / almost-lockup).
Reason for notify-send failure? Unknown / more (Internet?) investigation needed.
Possibly a bug report about mal-functioning needrestart package should be filed.
Ah, a related bug:
"needrestart: notify-send timeout instead of notify"
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1024426 HTH!