Cannot open display error when I run sudo gedit on Ubuntu 14.04.5

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
-1
down vote

favorite












solitude@Solitude:~/Desktop$ sudo gedit ~/.bashrc
error: XDG_RUNTIME_DIR not set in the environment.

(gedit:12631): Gtk-WARNING **: cannot open display:









share|improve this question



















  • 1




    You can't run X11 apps without an X11 display for them to connect to. You might want the vi command instead of gedit there.
    – dobey
    Mar 28 at 15:37














up vote
-1
down vote

favorite












solitude@Solitude:~/Desktop$ sudo gedit ~/.bashrc
error: XDG_RUNTIME_DIR not set in the environment.

(gedit:12631): Gtk-WARNING **: cannot open display:









share|improve this question



















  • 1




    You can't run X11 apps without an X11 display for them to connect to. You might want the vi command instead of gedit there.
    – dobey
    Mar 28 at 15:37












up vote
-1
down vote

favorite









up vote
-1
down vote

favorite











solitude@Solitude:~/Desktop$ sudo gedit ~/.bashrc
error: XDG_RUNTIME_DIR not set in the environment.

(gedit:12631): Gtk-WARNING **: cannot open display:









share|improve this question















solitude@Solitude:~/Desktop$ sudo gedit ~/.bashrc
error: XDG_RUNTIME_DIR not set in the environment.

(gedit:12631): Gtk-WARNING **: cannot open display:






sudo gedit hadoop environment






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 29 at 20:01









Zanna

48k13119228




48k13119228










asked Mar 28 at 14:57









Varun Sahdev

61




61







  • 1




    You can't run X11 apps without an X11 display for them to connect to. You might want the vi command instead of gedit there.
    – dobey
    Mar 28 at 15:37












  • 1




    You can't run X11 apps without an X11 display for them to connect to. You might want the vi command instead of gedit there.
    – dobey
    Mar 28 at 15:37







1




1




You can't run X11 apps without an X11 display for them to connect to. You might want the vi command instead of gedit there.
– dobey
Mar 28 at 15:37




You can't run X11 apps without an X11 display for them to connect to. You might want the vi command instead of gedit there.
– dobey
Mar 28 at 15:37










1 Answer
1






active

oldest

votes

















up vote
2
down vote













You should never use normal sudo to start graphical applications as root. For a complete explanation of this read the answers to this question: Why should users never use normal sudo to start graphical applications?.



Nautilus Admin (nautilus-admin) is a simple Python extension for the Nautilus file manager that adds some administrative actions to the right-click menu:



  • Open as Administrator: opens a folder in a new Nautilus window running with administrator (root) privileges.

  • Edit as Administrator: opens a file in a Gedit window running with administrator (root) privileges.

To install Nautilus Admin in all currently supported versions of Ubuntu open the terminal and type:



sudo apt install nautilus-admin


An alternative way of editing the same file is to use the system's default text editor program that is designed to run from the terminal without needing any other graphical environment.



sudoedit path/to/file





share|improve this answer






















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "89"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1019996%2fcannot-open-display-error-when-i-run-sudo-gedit-on-ubuntu-14-04-5%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    2
    down vote













    You should never use normal sudo to start graphical applications as root. For a complete explanation of this read the answers to this question: Why should users never use normal sudo to start graphical applications?.



    Nautilus Admin (nautilus-admin) is a simple Python extension for the Nautilus file manager that adds some administrative actions to the right-click menu:



    • Open as Administrator: opens a folder in a new Nautilus window running with administrator (root) privileges.

    • Edit as Administrator: opens a file in a Gedit window running with administrator (root) privileges.

    To install Nautilus Admin in all currently supported versions of Ubuntu open the terminal and type:



    sudo apt install nautilus-admin


    An alternative way of editing the same file is to use the system's default text editor program that is designed to run from the terminal without needing any other graphical environment.



    sudoedit path/to/file





    share|improve this answer


























      up vote
      2
      down vote













      You should never use normal sudo to start graphical applications as root. For a complete explanation of this read the answers to this question: Why should users never use normal sudo to start graphical applications?.



      Nautilus Admin (nautilus-admin) is a simple Python extension for the Nautilus file manager that adds some administrative actions to the right-click menu:



      • Open as Administrator: opens a folder in a new Nautilus window running with administrator (root) privileges.

      • Edit as Administrator: opens a file in a Gedit window running with administrator (root) privileges.

      To install Nautilus Admin in all currently supported versions of Ubuntu open the terminal and type:



      sudo apt install nautilus-admin


      An alternative way of editing the same file is to use the system's default text editor program that is designed to run from the terminal without needing any other graphical environment.



      sudoedit path/to/file





      share|improve this answer
























        up vote
        2
        down vote










        up vote
        2
        down vote









        You should never use normal sudo to start graphical applications as root. For a complete explanation of this read the answers to this question: Why should users never use normal sudo to start graphical applications?.



        Nautilus Admin (nautilus-admin) is a simple Python extension for the Nautilus file manager that adds some administrative actions to the right-click menu:



        • Open as Administrator: opens a folder in a new Nautilus window running with administrator (root) privileges.

        • Edit as Administrator: opens a file in a Gedit window running with administrator (root) privileges.

        To install Nautilus Admin in all currently supported versions of Ubuntu open the terminal and type:



        sudo apt install nautilus-admin


        An alternative way of editing the same file is to use the system's default text editor program that is designed to run from the terminal without needing any other graphical environment.



        sudoedit path/to/file





        share|improve this answer














        You should never use normal sudo to start graphical applications as root. For a complete explanation of this read the answers to this question: Why should users never use normal sudo to start graphical applications?.



        Nautilus Admin (nautilus-admin) is a simple Python extension for the Nautilus file manager that adds some administrative actions to the right-click menu:



        • Open as Administrator: opens a folder in a new Nautilus window running with administrator (root) privileges.

        • Edit as Administrator: opens a file in a Gedit window running with administrator (root) privileges.

        To install Nautilus Admin in all currently supported versions of Ubuntu open the terminal and type:



        sudo apt install nautilus-admin


        An alternative way of editing the same file is to use the system's default text editor program that is designed to run from the terminal without needing any other graphical environment.



        sudoedit path/to/file






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Jun 2 at 23:41

























        answered Mar 28 at 15:26









        karel

        50.7k11107127




        50.7k11107127



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1019996%2fcannot-open-display-error-when-i-run-sudo-gedit-on-ubuntu-14-04-5%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            pylint3 and pip3 broken

            Missing snmpget and snmpwalk

            How to enroll fingerprints to Ubuntu 17.10 with VFS491