无需重登/重启:Unity会话故障及顶栏缺失的修复方法问询
Alright, I’ve fought this exact Unity issue more times than I can count—especially after running unity --reset-icons && killall -9 compiz to trigger the bug. No need to log out or reboot; here’s how to fix it step by step:
1. Restore Compiz (Window Manager)
The hard kill on compiz is usually the root cause of the messed-up session. Open a terminal (use Ctrl+Alt+T if the top bar is gone, or switch to a TTY with Ctrl+Alt+F2, log in, then run these commands before switching back with Ctrl+Alt+F7):
- Stop any leftover compiz processes cleanly:
killall -SIGTERM compiz - Restart compiz properly and detach it from the terminal so it stays running:
compiz --replace & disown
2. Bring Back the Top Bar & Unity Applets
If the system menu top bar and applets are still missing, restart the Unity panel service:unity-panel-service --replace & disown
This should immediately restore the top bar, including the system menu, indicators, and applets.
3. Fix Unresponsive dconf/gsettings
Even if dconf-service is running, cached settings might be blocking changes. Reset the Compiz and Unity-related dconf entries to default:
- Reset Compiz configuration:
dconf reset -f /org/compiz/ - Reset window manager settings:
dconf reset -f /org/gnome/desktop/wm/ - After resetting, re-run the compiz and panel service commands from steps 1 and 2 to apply the fresh settings.
4. Bonus: Restore Unity Icons (If Needed)
If your desktop icons are still messed up after the above steps, run:unity --reset-icons & disown
This refreshes the icon layout without breaking the session again (just avoid hard-killing compiz right after!).
Testing the Fault Environment
To replicate the issue for testing, use the exact command you mentioned:unity --reset-icons && killall -9 compiz
This reliably triggers the broken session state, so you can test the fixes above.
内容的提问来源于stack exchange,提问作者ubuntroll

