This simple tutorial will explain how to restart unity and unity-2d in Ubuntu. Normally we need to restart unity only when meet a “no response” problem. If restarting unity can’t fix your issue, maybe you need to try restart your X display manager.

Restart unity without reset compiz

You can press ALT+F2, then type “unity” in Run a command box and then click ENTER to restart unity.

Or you can run below command in terminal(Ctrl+ALT+T) to restart unity:

setsid unity

Restart unity by restarting compiz

Execute this command in terminal:

setsid compiz --replace

Restart Unity 2D:

Run below commands in your terminal to restart unity 2D:

pkill unity-2d-shell
pkill unity-2d-panel

Restart X display Manager

If above methods can’t fix your issue,you may need to try restart your X display manager.

Note:All opened applications will lost

sudo -s
setsid service lightdm restart