[Quick Fix] Ubuntu 20.04 Takes Very Long to Shutdown

It takes too long when you shutdown Ubuntu? Let me show you how to fix the problem in Ubuntu 20.04, Ubuntu 20.10, and other Ubuntu releases.

When you click shutdown your Ubuntu Linux machine, it asks all running processes to stop. Some processes misbehavior and keep on running. The shutdown process will wait the running processes to stop for a predefined time period. And finally it sends kill signal to force stop all the remaining running processes and shuts down the system.

In Ubuntu, it’s usually the snap daemon that causes a delay to the shutdown process. When shutdown Ubuntu, press F2 on keyboard to print the information. You’ll see something says “A stop job is running for Snap Daemon“. And it waits for 90 seconds before force to terminate the process.

To fix this slow shutdown problem, you can either fix the process which causes the issue or change the time delay before Ubuntu force to stop the process.

While it’s not easy for common users to fix a specific software issue, here’s how to change the timeout from 90s to a very short time (5 seconds for example).

  1. Open terminal from your system application menu. When it opens, run command to open the configuration file:
    sudo gedit /etc/systemd/system.conf

    You can replace gedit with other text editor, e.g., xed for Linux Mint, based on your desktop environment.

  2. When the file opens, scroll down and find out the line #DefaultTimeoutStopSec=90s. Remove # at the beginning and change value from 90s to 5s, so it will be DefaultTimeoutStopSec=5s

  3. Finally apply the change by reloading the systemd daemon via command:
    systemctl daemon-reload

That’s it. Enjoy!

Exit mobile version