Re: xhost +localhost doesn't work
Problem is solved. My thanks to all who offered suggestions.
Perhaps the below may be useful to someone, sometime.
Several things went wrong - first the ugly.
xhost +localhost examines the /etc/hosts file to make sure
the host (localhost in this case) is valid.
I had copied over the most recent hosts file from another computer.
Unfortunately, it was a Windows computer so the file had crlf instead of simple lf
line endings. I discovered all those ^M at the end of line when I fired up joe
to make sure localhost was in the file - it was but guess the ^M confused xhost.
My bad - sorry.
After running dos2unix on /etc/hosts I was able to
xhost +localhost
However that still required me to
export DISPLAY=:0
each time.
Here is the good.
I read Rob Weir's discussion about setting the XAUTHORITY variable
in the su environment.
I like aliases so I set up a new
alias sup='su -p'
The -p variable preserves the user's environment and shell,
including the XAUTHORITY variable.
Now I
sup
and just run synaptic (my test "suite") and up it comes!
Here is the bad which turns out good:
For some time I could not
su -
for some reason. I always got an
su: unknown id -
error message.
While looking for a nice stop in bashrc for my sup alias I
found this:
alias su='su -'
Gee I had forgotten about that and immediately
changed it to
alias su-
The moral of that story is be careful about making aliases with the exact same name
as programs that take special parameters like su -
since the - is easily confused with an option.
In my case I was really typing
su - -
each time - no wonder it didn't work.
Again thanks to all who helped.
Larry Alkoff
Larry Alkoff N2LA - Austin TX
Reply to: