Find the answer to your Linux question:
Results 1 to 4 of 4
I'm trying to install a program from a .sh file and I use the command "sh" I get this error: The DISPLAY variable is not set. You should either login ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jan 2006
    Posts
    2

    Question can't figure out how to install with su and sh


    I'm trying to install a program from a .sh file and I use the command "sh" I get this error:

    The DISPLAY variable is not set. You should either login to as root or use
    the command "su" with no flags, to make sure setup has an X display to use.

    Then I tried su commands and xhost and this is what I got:

    XANN3OMVT56:/home/adam/Shared# su
    XANN3OMVT56:/home/adam/Shared# xhost +localhost
    xhost: unable to open display "localhost:0.0"
    XANN3OMVT56:/home/adam/Shared# export DISPLAY=localhost:0.0
    XANN3OMVT56:/home/adam/Shared# xhost +localhost
    xhost: unable to open display "localhost:0.0"
    XANN3OMVT56:/home/adam/Shared# sh install.sh

    Verifying archive integrity...OK
    Uncompressing CrossO............................................
    you have no permissions to access the X server (localhost:0.0) it points to.
    Try running xhost +localhost before su'ing to root.



    I tried diffent comdinations just to be sure I just didn't do it in the right order

  2. #2
    Linux Enthusiast
    Join Date
    Apr 2004
    Location
    UK
    Posts
    728
    The line "xhost +localhost" must be run as the user who owns the console. That is the user you logged into X as.

    If you su to root first, it doesn't have permission to alter the X session so it can't add permissions for localhost.

    Let us know how you get on

    Chris...
    To be good, you must first be bad. "Newbie" is a rank, not a slight.

  3. #3
    Just Joined!
    Join Date
    Jan 2006
    Posts
    2

    no change

    I just tried that and got the same result... it says this before I do the su command:

    access control disabled, clients can connect from any host


    any ideas??

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Enthusiast
    Join Date
    Apr 2004
    Location
    UK
    Posts
    728
    Try dropping the localhost when setting up the display.

    Code:
    #export DISPLAY=:0.0
    #sh install.sh
    Also, which distro are you using? Having access controls disabled is unusual in my experience (unless you ran "xhost +" by itself).

    Let us know how you get on

    Chris...
    To be good, you must first be bad. "Newbie" is a rank, not a slight.

Posting Permissions

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