"cannot open display: :0" error when using sudo with any GTK app

7,789

For graphical applications use gksu:

gksu gsmartcontrol

If it is not installed on your system you can get it via:

apt-get install gksu

Share:
7,789

Related videos on Youtube

HeavyHydrogen
Author by

HeavyHydrogen

Updated on September 18, 2022

Comments

  • HeavyHydrogen
    HeavyHydrogen over 1 year

    I want to run gmsartcontrol (UI tool for smartctl) which needs to be run as root in order to access the drives and read their SMART status.

    However doing this:

    sudo gmsartcontrol

    I get this error:

    No protocol specified
    [gtk] cannot open display: :0