36

I am using Ubuntu 12.04.1 LTS Desktop.

My son and I are playing games on GCompris and several modules freeze/lockup.

When it does, I don't know how to close the program.

I know in Windows I could use ctrl-alt-del to get to the task manager to shut it down.

Is there an equivalent to this in Ubuntu?

1

8 Answers 8

78

Press ALT+F2, type xkill. The mouse pointer on screen will change to a cross.

Then with it, you can simply click on the window you want to close.

4
  • 11
    best user experience ever Feb 8, 2016 at 19:58
  • 2
    This should have been the accepted answer. Nov 16, 2017 at 7:35
  • 1
    After using Ubuntu for 5 years, this is my fastest solution ever! Thank you! Nov 8, 2020 at 15:13
  • This also works in remote desktop view mode (AnyDesk, probably TeamViewer, others?). It does not work running xkill from Terminal (Ctrl + Alt + T).
    – Orr22
    Jan 5, 2021 at 18:39
28

This is my "linux emergency cheat sheet":

1. Non responsive application

SUPER --> type in System Monitor --> RETURN --> find process --> right click --> Kill Process

or

ALT + F2 --> type in xkill --> x marks the spot (or in this case frozen app)

or

CTRL + ALT + T --> type in top --> find process ID --> k PID where PID = process ID

Effect: This kills the program.


2. Non responsive desktop

CTRL + ALT + F1 --> type in sudo service lightdm restart

Effect: This kills the session and starts a new one.


3. Non responsive system

LAST RESORT. ONLY USE WHEN EVERYTHING ELSE FAILS:

Hold ALT + SysRq down and hit the following keys in the given order:

R --> E --> I --> S --> U -->B

This is where you find the magic SysRq key:

enter image description here

Effect: This restarts the system but only after performing the following actions:

unRaw      (take control of keyboard back from X),
 tErminate (send SIGTERM to all processes, allowing them to terminate gracefully),
 kIll      (send SIGKILL to all processes, forcing them to terminate immediately),
  Sync     (flush data to disk),
  Unmount  (remount all filesystems read-only),
reBoot.

Bonus mnemonic: Reboot Even If System Utterly Broken

5

Just open from your Start "Menu" > system > system monitor In there you will find the tasks that are running and you can close them.

You could also try ALT+F4

to close a running application in foreground.

Another possibility would be to use Ctrl+ALT+F4

You have to login there with your user account. Then you could run

top

If you want to "kill" a process you write down the "PID" Number. Then you type in top:

k number_of_PID

number_of_PID is the PID number you just wrote down. The process should then end.

4

This actually happened to me on 18.04 today Alt-F2 and xkill did not work for me

I ended up logging out and logging back in and when it finished logging me back in the stubborn app was gone

2
  • 1
    It absolutely does. Read the Question again. It asks....QUOTE..."How can a frozen/locked-up program/app be closed?" The ONLY way I was able to close the locked program on my 18.04 installation was exactly as I described. Nothing else worked. The two replies above seem to imply that simple, yet effective solutions are not acceptable.
    – User6655
    Nov 2, 2018 at 12:59
  • Answer upvoted This does respond to the question. No robo-reviewing, please?
    – Fabby
    Nov 2, 2018 at 19:06
2

Using Alt + F2, xkill is a good option for applications having a window to click on.

Sometimes an app crashes and there's no more a window showing but the application is still frozen in the background. In this case you could use "System monitor" to kill it.

1

A way to kill processes that freeze is by the terminal. Open terminal, Ctrl + Alt + T then you can type this command.

sudo ps -aux | grep -inE (name of application)  # no parenthesis.

For example, for a calculator, sudo ps -aux | grep -inE calc Then, something like this will come up.

210:(computer name)   7645  0.0  0.4 630824 37700 ?        Sl   Mar15   0:17 gnome-calculator
240:(computer name)  10403  0.0  0.0  14224   964 pts/2    S+   22:04   0:00 grep --color=auto -inE calc

the first number, 7645 for the first application is its id number. So, to kill it, type

sudo kill 7645

**note for sudo ps -aux | grep -inE calc I could have typed in, sudo ps -aux | grep -inE calculator to be more specific.

**extra note, sudo is not needed for sudo ps -aux | grep -inE calc.

1
  • I don't think you need sudo to look for the process and you won't need grep's -E flag there. Also there's pgrep and pkill...
    – Zanna
    Mar 22, 2017 at 3:06
0

I had this problem with ghost windows that remain after you have closed the main program on Ubuntu 18.4. To at least work around it without restarting your Ubuntu, install xdotool in the following way:

sudo apt install xdotool

Then you can use the following command to kill all open windows:

xdotool search "" windowkill %@
0

Tested using Ubuntu 20.04.0 LTS

  1. Click on the Activities link
  2. enter xkill
  3. Mouse symbol changes to an "X"
  4. Move mouse pointer to a window controlled by the process to make quit
  5. Click on window.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.