49

I am having this weird problem in Ubuntu 18.04. My laptop gets stuck at the shutdown screen every time I use shutdown and I have to manually press the power button for 5 seconds to turn the machine off.

Before 18.04, I was using Ubuntu 16.04 and it never got stuck at shutdown.

Any fix for this?

Zanna
  • 70,465
Peter
  • 815
  • 1
    Does it freeze on a black screen? – YoureSOStubborn Apr 28 '18 at 07:03
  • 1
    Until the problem is solved it may help with SysRq REISUB. It will reboot the computer gracefully. The corresponding shutdown/poweroff is SysRq REISUO – sudodus Apr 28 '18 at 07:45
  • 1
    It freezes when it shows ubuntu logo – Peter Apr 28 '18 at 08:08
  • 1
    Have you tried SysRq REISUB or SysRq REISUO yet? In that case, does it help? – sudodus Apr 28 '18 at 09:08
  • 2
    How long did you wait? I see a 90 second CUPS timeout sometimes on 18.04 shutdown. – ubfan1 Apr 28 '18 at 15:17
  • @ubfan1 Occasionally on 16.04 my shutdown would be inhibited for 90 seconds or so too. – WinEunuuchs2Unix Apr 29 '18 at 19:35
  • I am not sure what happened now, but somehow it has shutting down properly. But now I am seeing regular system crashes. No idea what is happening here :) – Peter Apr 30 '18 at 06:22
  • I got same problem with 18.04. In my case it not showing the logo page but shows shutdown process. In shutdown it printing a lot of error on nouveau (nvidia VGA) – Naser Hamidi May 06 '18 at 14:43
  • Tried all the new solutions in the comments but still same. :/ – Peter May 22 '18 at 12:35
  • Same problem here in my Acer Travelmate laptop. What I noticed is (1) if I turn off after short use (without leaving idle with screen locks) it turns off fine. (2) Turning off after unlocking the screen hangs (in this case I have tried sudo poweroff also but still hangs). (3) Once I noticed windows style install update and shutdown thing... Not sure if it tried to install updates during shutdown process. But I didn't find any updates to be installed when checked. I hope I have given some clue for someone to investigate deeper on this issue. :) – Deepak Shrestha May 24 '18 at 23:29
  • 1
    look for errors in file /var/log/syslog after you boot back up – Scott Stensland Dec 28 '18 at 16:50
  • On Lubuntu 20.04 shutdown and reboot both hang on a Lubuntu splash screen. I hit the ESC key and was dropped into some text output. The screen is filled with lines with timestamps and among them shows: watchdog: BUG: soft lockup - CPU#3 stuck for 22s! [systemd-shutdow:1]. and CPU: 3 PID: 1 Comm: systemd-shutdow Tainted: G L 5.4.0-54-generic #60-Ubuntu It seems to be stuck in some kind of loop and repeats every 20 seconds or so. This is with a brand new install. – User Nov 30 '20 at 01:32

21 Answers21

24

While none of the other answers here helped for me (encountering the same problem), I fixed it by switching from the X.org graphics driver to the propietary nvidia driver that is recommended under software&updates. Since then, reboot works flawlessly.

My setup: Asus G Series Laptop G501VW, with Nvidia 960M graphics card.

To do this:

  • open Software&Updates (top left: Click on activities and type "software". Pick software&updates)
  • go to "additional drivers"
  • select a nvidia driver instead of the X.org driver
  • reboot the system
rob
  • 405
  • 1
    For me, no solution has worked till now. Whatsoever I tried, I might have to switch back to previous version as this issue has no solution. – Peter Jun 28 '18 at 05:21
  • I'm using Elementary OS Juno with the same hardware (ASUS ROG G501VW). And I can confirm this solution has solved the problem. – frm.adiputra Oct 19 '18 at 08:11
  • This one also worked for me - desktop with GeForce GT640. I've switched to nvidia-driver-390. – mdob Jan 21 '19 at 08:11
  • It solved the problem for me as well. Asus Zenbook with Nvdia GTX 1050 – Martín De la Fuente Apr 05 '19 at 19:37
  • 1
    This worked for MSI GL Laptop with GTX 1050Ti, Ubuntu additionally prompted setting a password for secure boot and using it on next boot. – aksh1618 Jun 01 '19 at 22:31
  • 2
    I found too many nouveau related issues in /var/log/syslog. So I used sudo ubuntu-drivers autoinstall to install NVidia drivers. It works fine now. Had to undergo enrolling new MOK procedure. Xiaomi Notebook Pro. – takeshi Jun 28 '19 at 09:55
  • 1
    its not immediately obvious how to do the above – Baama Jul 24 '19 at 13:44
  • Thanks, worked for asus a509fj,, first time install in this notebook.. – Budi Mulyo Aug 06 '19 at 23:06
  • Finally! Thanks a million! – Heschoon May 13 '20 at 09:45
15

Same problem here on my laptop. After some observation, I found out that it has something to do with power saving mode specially automatic suspend.

Go to Settings > Power then turn off all Automatic Suspend options. Also choose Blank screen to Never.

Till Ubuntu team will figure out why suspend mode is interfering with shutdown process, this solved my problem.

Hope this helps

  • I will try this :) – Peter Jun 02 '18 at 14:37
  • This fixed the problem. Hope ubuntu will send a fix soon – User123456 Sep 06 '18 at 07:40
  • Also this solution does not work for me. – Carmine Mar 10 '19 at 16:16
  • This worked for me: change Bios Graphic card from Discrete to UMA : https://forums.lenovo.com/t5/Linux-Discussion/Legion-Y520-Freeze-when-try-to-shutdown-or-restart-after-fresh/td-p/4162896 – Carmine Mar 17 '19 at 16:36
  • There seems to be multiple cause for this. I recently bought a desktop and had dual boot with Ubuntu 18.04 LTS. Faced the same issue regardless of power settings I suggested earlier.

    However when I try to sudo poweroff from terminal it works as expected (shuts down fast without any delay)

    Not sure if any issue with permissions during the shutdown process.

    – Deepak Shrestha Mar 21 '19 at 10:04
  • 1
    I'm seriously surprised - this actually worked for me – masahane Sep 25 '19 at 02:37
  • On ubuntu 20.04, now I can lock the screen again...Still cannot reboot/power off (now black screen and nothing happens..before it was just stuck). To note that this happens to me only when I use a dell usb dock station to attach 2 additional monitors to the laptop. I have updated nvidia and displaylink drivers – BangTheBank Oct 21 '21 at 09:10
  • Solved it for me on Ubuntu 20.04. – B0rk4 Nov 30 '21 at 05:41
  • Fixed it for me on ubuntu 18.04 – soma sekhar Jul 07 '22 at 06:07
6

Try a couple of sudo reboots from terminal to see if it clears things up: 1st to try, reboot without writing wtmp file:

sudo reboot -d

If that reboots successfully then try your natural close down. If it doesn't reboot, try forced reboot:

sudo reboot -f

If this was an upgrade from 16.04 to 18.04, it may be worth considering a clean install.

Broadsworde
  • 4,132
  • 4
  • 28
  • 45
6

I had this problem and in my case it seems to be related to the Intel Bay trail CPU which is causing some firmware bugs.

Anyway I have a solution which isn't the best but good enough for now

Solution:

  • Open the terminal and run

    sudo -H gedit /etc/default/grub
    
  • Edit GRUB_CMDLINE_LINUX_DEFAULT="quite splash" so that it says

    GRUB_CMDLINE_LINUX_DEFAULT="intel_idle.max_cstate=1"
    
  • Save and exit, and write the changes to GRUB's actual config file:

    sudo update-grub
    
  • Restart your computer forcefully one last time

Let me know if it worked or when you have a better solution

Zanna
  • 70,465
Sunny Ray
  • 111
2

There are scores of scripts that run when you shutdown. I'm still on 16.04 and for me these are the ones in /etc/rc0.d (which are really links to /etc/init.d). One of them may have a long delay set in what it does for stop.

AFAIK these scripts are run in alphabetical order, so you can insert a few that would just log their execution somewhere, helping you spot where the delay is.

xenoid
  • 5,504
2

Had the same problem on a brand new ASUS N705u. Found had to do with how the video driver installs which causes a conflict with the "secure boot" function of the BIOS. Solution: Turn the "secure boot" function off until other solution will become available.

Karl S.
  • 31
  • Do you have any more information, like which video driver causes the problem, and how it causes a problem with secure boot that inhibits shutdown? – Hee Jin May 08 '18 at 15:44
  • That laptop comes with a NVIDIA GeForce MX150 graphics card. During installation of Ubuntu 18.04 a remark is made that a third party driver is needed which requires safe boot option to be turned off. It also asks for a password to allow safe boot disabling process. However, this password is never being asked for and it appears safe boot remains on regardless. (BIOS -ASUS 302). – Karl S. May 09 '18 at 23:04
  • Also after initial installation a third party driver "GP107M" is being downloaded and installed. A second computer - same model, that initial question doesn't come up during install once safe boot is disabled in BIOS – Karl S. May 09 '18 at 23:11
  • 1
    UPDATE: As mentioned above got two new computers with new Kubuntu 18.04 installs. Both kept playing up either on shutdown or then suddenly during the final stages of starting up. - Turns out it's the WIFI Manager ! Turn my WIFI Repeater off - all good. But if it's on those problems are back! – Karl S. May 10 '18 at 07:35
  • In my case, Wifi router was not even switching off/on even when pressing the Wifi button. – Peter Jul 09 '18 at 07:19
1

My system is an older Dell Dimension E521 desktop, dual core, with Lubuntu 18.04, 64-bit.

In /etc/default/grub, I removed acpi=off and the system started behaving normally.

More specifically, I changed this:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash noapic acpi=off"

to:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash noapic"

Now my box once again shuts down when I tell it to, and is refreshingly responsive.

David
  • 3,367
2785528
  • 151
  • 3
  • 1
    do you suffer from dyslexia, or are these actually 3 different yet valid arrangements of letters A, C, P and I? – Adam Mar 27 '20 at 11:04
  • @Adam - "ACPI, known as a Hardware Abstraction Layer (HAL) in embedded computing, is an abstraction layer between the operating system, platform firmware and hardware. This allows the OS and the platform to evolve independently. ... " and "Most (all) Intel-MP compliant SMP boards have the so-called ‘IO-APIC’, which is an enhanced interrupt controller." and yes, I just checked and the last 'noapci' should be 'noapic'. Thanks. – 2785528 Mar 27 '20 at 18:36
1

In my case, i have the driver nouveau, Ubuntu 18.04

Solution:

Open terminal

sudo gedit /etc/default/grub

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_rev_override=1 nouveau.modeset=0"

sudo update-grub

This solved the issue for me, now i can shutdown and restart

1
  1. open terminal and type : sudoedit /etc/default/grub
  2. change GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" into GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi=force"
  3. save the file
  4. sudo update-grub

that's it ... it worked for me

1

I had the same issue after a kernel upgrade. Shutdown/restart command was working smoothly before the upgrade. But started freezing after the upgrade. I attempted all fixes that are mentioned here and various other forums but nothing seemed to work. So I started installing various versions kernels and checked up shutdown command with different kernels and found that my machine freezes for all kernels greater than the following version:

linux-image-4.15.0-20-generic 

My PC has the following specifications:

Intel Core i5-8250U
NVIDIA Geforce MX150 with 2 GB VRAM

I had the same issue when I installed Kali along with Ubuntu. Searching for its solutions I found it was probably a GPU issue and disabling the generic nouveau driver might fix it.

I applied the solution given below for kali:

  1. Check your apt sources as per https://docs.kali.org/general-use/kali-linux-sources-list-repositories
  2. Run apt-get update && apt-get dist-upgrade
  3. Create the following file: /etc/modprobe.d/nouveau-blacklist.conf
  4. Edit that file and add only one line that says blacklist nouveau
  5. Reboot your PC.
  6. Run apt-get install libcuda1 libnvidia-ml1 --no-install-recommends -y
  7. Dn not reboot your PC at this point. You must edit one file before doing so or your GDM greeter won't work
  8. Edit the file /etc/modprobe.d/nvidia.conf and comment out the second line that says remove nvidia-current rmmod nvidia nvidia-uvm, or delete that line. Make sure that file has only one line that says alias nvidia nvidia-current
  9. Run apt install nvidia-kernel-amd64 nvidia-kernel-common nvidia-kernel-dkms
  10. Reboot your PC.

https://forums.kali.org/showthread.php?27173-Solution-for-Reboot-Issues

and it worked for my kali. Applied the same for my Ubuntu, and it worked.

zorbamj
  • 33
1

Imad's suggestion: change

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" 

into

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi=force"  

This is the only solution that works consistently for me. Will take that back. Nothing on this page works for me. AMD Turion X64 Duo Core Toshiba A215

1

For my Lenovo E580 the solution was adding the open ubuntu graphics drivers from https://launchpad.net/~oibaf/+archive/ubuntu/graphics-drivers

sudo add-apt-repository ppa:oibaf/graphics-drivers
sudo apt-get update
Dman
  • 61
  • This worked for me though not immediately but after several updates spanning several days my Kubuntu 18.03.3 LTS finally restarted and shutdown gracefully – David Jan 21 '20 at 17:37
0

After doing more testing on two computers found it is in fact the Wifi Manager and the way it connects / identifies with the network. On two identical computers the problem disappears once the Wifi manager is turned off. Also tried USB Wifi dongle which worked on one computer but once again caused system to freeze at moment of registration on network. Have already tried a different Wifi manager with improved conditions. Also noticed in BIOS if secure boot is disabled then there is a list of drivers rejected bi BIOS due to security issues. Perhaps this is the underlying issue related to the Wifi manager.

Karl S.
  • 31
  • Temporary fix: a) Turn Wifi off or b) Try disabling original Wifi Manager and install different one instead. – Karl S. May 13 '18 at 01:04
  • The unsecure driver theory and wifi makes sense to me. In my case, I installed a modified WiFi driver and since then the problem began. Will be trying disabling secureboot. – Rohitt Vashishtha May 25 '18 at 07:11
0

I had success turning off usb 3.0 driver in bios, not ideal, but it is fixed until more research is done.

0

I noticed that it happens to me too if i use my laptop for more than 10 hours, the gnome-shell uses more memory with time starting from 200 and going up to 500, firefox too starts with memory usage of 150 and goes all the way up to 900, restarting my laptop every 4 to 5 hours solved the issue of shutdown freezing for me I hope it helps you.

0

I had the same problem after installing 18.04 on a Fujitsu Scaleo.

During the install I had to add the acpi=off to be able to install Ubuntu because of a conflict with the Intel 82G33/G31 Express Integrated Graphics Controller. After that Ubuntu would just halt at System Halted when I shut it down.

In the end I changed the BIOS ACPI Suspend Type from S3 to Auto. I did this in Power Management. After this the PC would power down and I could even remove the acpi=off from Grub.

Mattijs
  • 113
  • 1
  • 9
0

I had similar problem with ubuntu 18.04. I installed nvidia driver and now it works fine. Install your driver as described in https://linuxconfig.org/how-to-install-the-nvidia-drivers-on-ubuntu-18-04-bionic-beaver-linux

0

I don't know why but for me, when I remove whole "quite splash acpi=off" and leave it blank, the issue is gone. Now my PC boot and reboot smoothly

  • Hi! This is truly more of a comment rather than an answer. Your 'fix' is probably the acpi=off part - the quiet suppresses boot messages, and the splash displays a pretty image during boot. – Charles Green Dec 28 '18 at 16:48
  • Yeah I'm just a newbie. But tried all above solution but it didn't work for me. So I tried remove all three of it and magically it reboot and boot without stuck. – Lemaire Dec 28 '18 at 18:38
  • Nothing works like success! Why did your system have that boot option set? – Charles Green Dec 28 '18 at 19:17
  • It is there by default – Lemaire Dec 30 '18 at 10:05
0

Had the same problem yesterday while installing 18.04 As mentioned earlier in the post. updating NVIDIA drivers. There are several ways of doing this but i recommend following steps

  1. find your graphics card name and download it.
  2. run following commands sudo dpkg --add-architecture i386 sudo apt update sudo apt install build-essential libc6:i386

  3. reboot

  4. on start run sudo telinit 3

  5. use terminal to navigate to Downloads folder and type sudo ./the driver download file

  6. after install: sudo reboot

0

I solved it by this way below(dell laptop with Ubuntu 18.04):

Open the Terminal and input this line: sync && sudo sync press Enter, and continue to input the second line: sudo shutdowm -h now or sudo reboot press Enter. If it works well. and then you can normally shutdowm or reboot your system as usual.

Kulfy
  • 17,696
0

Yes, it's a pain.

In my case, turning acpi off in grub

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash noacpi"

then

sudo update-grub

and

reboot -d

did the trick.

Suspend mode and shutdown are behaving normally again. I don't know what caused the problem in the first place: I was having issues while using Unity, Ubuntu would freeze when working on a specific text file. So I installed XFCE to see whether it was a UI problem or a hardware (disk-related) problem. Disks were supposedly clean and checked. With XFCE I no longer had freezes with the txt file, but shutdown and suspend would not work anymore...