Why do my computers take a long time to shut down?

Slow shutdown after an update can be caused by orphaned packages that are no longer used or required for anything following a software update. If so, searching for orphaned packages and uninstalling them will solve the problem.

List orphaned packages:

pacman -Qtdq

If the above command finds any orphaned packages you can uninstall them with pacman. Uninstalling orphaned packages one at a time is preferable to uninstalling all of them with a single command, because some packages that are reported as orphaned packages may still be required by another package if that package was manually downloaded and installed, not installed with pacman from your currently enabled software repositories.


How I solved my question:

  1. Found the time gap in the log by the command: sudo journalctl -b -1 -e --no-pager (the time gap in my case is 2 minutes)
  2. I typed the information obtained from the logs into a search engine and found a solution: bbs.archlinux.org/viewtopic.php?id=261530
  3. Executed the command: systemctl edit --user gnome-session-restart-dbus.service and add the following lines above ### Lines below this comment will be discarded:
[Service]
Slice=-.slice