Can't shutdown xubuntu after updating to 16.04

12,467

Solution 1

I have same problem in my laptop dell Inspiron 5110. After tried this, my computer shutdown normaly

sudo init 0

Solution 2

The accepted answer sudo init 0 doesn't work for me in Xubuntu based in Ubuntu 16.04.

While waiting for a patch this is how I can shutdown my laptop:

Using poweroff

  • sudo poweroff -f

-f to force the computer to shutdown without contacting the init system.

Detecting the process that prevents the computer to shutdown

In my case there is always the tty process that blocks the poweroff process. So detecting it, killing the process and starting the systemctl target.

  • ps aux | grep tty

    root 983 0.0 0.0 15408 1128 ? Ss 11:49 0:00 /bin/systemd-tty-ask-password-agent --wall

  • Kill the process: sudo kill 983

  • Shutdown the computer: First sudo systemctl start poweroff.target and if it fails execute the command again: sudo systemctl start poweroff.target.

Related questions

Solution 3

@marcanuy's answer works for me on Ubuntu 16.04. If you want to use the second method in that answer, here is a script you can put in your .bashrc to do that easily:

shutdown_workaround() {
    TTY_PID=$(ps aux | grep -v grep | grep -Po "root +\K[0-9]+(?= .*systemd-tty-ask-password-agent)")
    sudo kill $TTY_PID
    sudo systemctl start poweroff.target || sudo systemctl start poweroff.target
}
Share:
12,467

Related videos on Youtube

Mohit Rajan
Author by

Mohit Rajan

Updated on September 18, 2022

Comments

  • Mohit Rajan
    Mohit Rajan over 1 year

    I updated from Xubuntu 16.04 beta-2 to 16.04 today. And now I can't shutdown my laptop but I am able to restart. When I try it the GUI way it just logging out.
    When I tried

    sudo shutdown -h now
    

    I got the following error:

    Failed to start poweroff.target: Transaction is destructive.
    See system logs and 'systemctl status poweroff.target' for details.
    

    Output of /var/log/messages:

    tail /var/log/messages
    tail: cannot open '/var/log/messages' for reading: No such file or directory
    

    Output of systemctl status poweroff.target

    ● poweroff.target - Power-Off
       Loaded: loaded (/lib/systemd/system/poweroff.target; disabled; vendor preset:
       Active: inactive (dead)
         Docs: man:systemd.special(7)
    
    • Bunjip
      Bunjip about 8 years
      I experience exactly the same on my DELL Precision 5510 with a fresh 16.04 installation. Hope, someone comes up with a solution to this issue.
    • marcanuy
      marcanuy almost 8 years
      @Bunjip I've posted some alternatives to the previous answer
    • Bunjip
      Bunjip almost 8 years
      Thnx @marcanuy - I'll keep this in my mind in case I should ever experience this behaviour again. I ended up re-installing 16.04 from scratch and have not had this issue anymore
    • Ben Aveling
      Ben Aveling over 6 years
      This happened to me after installing a bunch of patches with no reboots in-between. I suspect that at least two of them 'didn't play well together'.
  • Sharique
    Sharique almost 8 years
    Even with this command my laptop (ideapad 500 acz) remains on, while shutdown process is complete.
  • XavierStuvw
    XavierStuvw over 7 years
    I experience the same problem with Ubuntu 16.04. My laptop is an Acer Aspire V 11 Touch. sudo init 0 did not work in my case and led to the same error message. sudo poweroff -f suggested by user marcanuy below worked, although drastically. I should also mention that in my case this has been a one-off incident. After powering on the problem with shutdown has not come up once again.
  • Garrett
    Garrett over 6 years
    Is the second way preferred? Does shutting down without contacting the init system have risks?
  • marcanuy
    marcanuy over 6 years
    @Garrett It won't be as safe as using unit, not sure about the risks involved but I never had problems with it, would be interesting to see that in its own question here though.
  • Ben Aveling
    Ben Aveling over 6 years
    I had this problem. This didn't work for me.
  • ndemou
    ndemou over 5 years
    @Garrett, man poweroff has you covered "-f [...] When specified once, this results in an immediate but clean shutdown by the system manager. When specified twice, this results in an immediate shutdown without contacting the system manager. See the description of --force in systemctl(1) for more details"