Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: sudo gedit X not working

  1. #1
    Join Date
    Jun 2008
    Location
    Belgi
    Posts
    174

    Question sudo gedit X not working

    How do I use sudo gedit [FILE] on openSUSE?

    It pulls out this error:
    isaak@unknown0015f26474fe:~> sudo gedit x
    Code:
    cannot open display: 
    Run 'gedit --help' to see a full list of available command line options.
    I've tried several possible solutions found on the internet but all without success.

  2. #2
    Join Date
    Mar 2008
    Location
    Bochum, Germany
    Posts
    3,587

    Default Re: sudo gedit X not working

    * EarthMind

    gnomesu gedit
    maybe?

    Uwe

  3. #3
    Join Date
    Jun 2008
    Location
    Belgi
    Posts
    174

    Default Re: sudo gedit X not working

    Thank you this works, but isn't there a solution to fix this because I can't even open my "Volume Control", it says: connection failed.

    I thought that perhaps these two errors could be connected.

    Many thanks

  4. #4
    Join Date
    Jun 2008
    Location
    Belgi
    Posts
    174

    Default Re: sudo gedit X not working

    I have found the cause of my last problem, this was because of a bug in Pulseaudio and so this question is answered. Thank you for your help.

  5. #5
    Join Date
    Jun 2008
    Location
    Belgi
    Posts
    174

    Default Re: sudo gedit X not working

    After a system reboot gnomesu doesn't work either, this error comes up:
    Code:
    Invalid MIT-MAGIC-COOKIE-1 keycannot open display: 
    Run 'gedit --help' to see a full list of available command line options.
    Is there any fix to get sudo gedit working?

  6. #6
    Join Date
    Mar 2008
    Location
    Bochum, Germany
    Posts
    3,587

    Default Re: sudo gedit X not working

    * EarthMind,

    something's wrong here, seems the apps cannot find the right display. Please try

    xhost +localhost
    sudo gedit

    if the latter line doesn't work:
    sudo gedit --display=0:0

    Uwe

  7. #7

    Default Re: sudo gedit X not working

    The problem is that sudo isn't keeping all of the necessary environment variables. Here's the fix.
    1. sudo /usr/sbin/visudo
    2. There is a line like this:
      Code:
      Defaults env_keep = "LANG LC_ADDRESS LC_CTYPE LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE LC_TIME LC_ALL LANGUAGE LINGUAS XDG_SESSION_COOKIE"
    3. Add (press i to switch vi to insert mode)
      Code:
      DISPLAY XAUTHORITY
      inside the quotes.
    4. Save and exit. (<Esc>:wq<Enter>)

  8. #8
    Join Date
    Jun 2008
    Location
    Belgi
    Posts
    174

    Default Re: sudo gedit X not working

    Many thanks for your help, dmbrown00's solution seem to have fixed it. I do hope that no more unexpected behavior will show up..

  9. #9
    ab@novell.com NNTP User

    Default Re: sudo gedit X not working

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    Probably in the wrong industry for that.... I would recommend
    grave-digging to meet your desires. :-)

    Good luck.






    EarthMind wrote:
    | Many thanks for your help, dmbrown00's solution seem to have fixed it. I
    | do hope that no more unexpected behavior will show up..
    |
    |
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.2 (GNU/Linux)
    Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

    iD8DBQFIalIZ3s42bA80+9kRAnWfAJ4yoiZX3cTW0YLv49cNuCsOKQ7c6ACePUtT
    hz6LjdcXDI1idq2TsURvbnY=
    =QIkQ
    -----END PGP SIGNATURE-----

  10. #10
    Tilman Schmidt NNTP User

    Default Re: sudo gedit X not working

    ab@novell.com schrieb:
    > Probably in the wrong industry for that.... I would recommend
    > grave-digging to meet your desires. :-)
    >
    > EarthMind wrote:
    > | Many thanks for your help, dmbrown00's solution seem to have fixed it. I
    > | do hope that no more unexpected behavior will show up..


    Even grave-digging comes with a risk of unearthing something unexpected.

    SCNR
    T.

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •