37

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?

Glutanimate
  • 21,393
Kobur
  • 371

8 Answers8

86

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.

Yanok
  • 1,101
29

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

Glutanimate
  • 21,393
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.

Zanna
  • 70,465
Peterling
  • 1,159
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

User6655
  • 106
  • 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 02 '18 at 12:59
  • Answer upvoted This does respond to the question. No robo-reviewing, please? – Fabby Nov 02 '18 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.

To Do
  • 15,502
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.

  • 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 '17 at 03: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.