You are not logged in.
Pages: 1
When I start a terminal, I enter "su -"
When I try to open any file, or simply enter gedit, I get:
========================================
** (gedit:1216): WARNING **: Could not open X display
Cannot open display:
========================================
Can someone please help?
Thank you.
Offline
What DE/WM you are using ?
Never argue with stupid people,They will drag you down to their level and then beat you with experience.--Mark Twain
@github
Offline
Expected behaviour.
I recommend that you use sux, rather than 'su -'.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
The env variable DISPLAY is the key. Try sudo -i instead:
$ su -
# env |grep DISPLAY
# leafpad
leafpad: Cannot open display:
# exit
$ sudo -i
# env |grep DISPLAY
DISPLAY=:0.0
# leafpad
<leafpad opens>
###
I recommend that you use sux
sux? Wuzzat?
Last edited by alphaniner (2012-12-04 19:19:23)
But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner
Offline
sux - wrapper around su which will transfer your X credentials
Use su (not su -), or sux, or sudo (sudo su, sudo -s, sudo -i).
su > gives you root permissions but it does not change the PATH variable and current working directory
su - > changes the PATH too... and root's home becomes your current working directory
Last edited by stressat (2012-12-04 19:27:53)
Offline
sux? Wuzzat?
Assuming you're not joking:
sux (wrapper around su which will transfer your X credentials)
$ sux root name-of-app
https://wiki.archlinux.org/index.php/Ru … ps_as_root
(edit) snaked again...
Last edited by 2ManyDogs (2012-12-04 19:24:39)
How to post. A sincere effort to use modest and proper language and grammar is a sign of respect toward the community.
Offline
I wasn't joking, but now I realize I should have worked out what it was. sux = su + X, naturally! This is Linux after all!
But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner
Offline
Do not forget about gksu(do) for launching GUI applications as root.
Offline
What DE/WM you are using ?
Gnome. Both Metacity and Mutte are installed.
In the past (before systemd), gedit never game me problems when entering su - in a terminal.
The DISPLAY=:0.0 didn't help.
Thanks in advance.
Offline
Something else which is entirely the fault of systemd!
All men have stood for freedom...
For freedom is the man that will turn the world upside down.
Gerrard Winstanley.
Offline
Yeaaaaah, if it worked before it was a bug.
from 'man su'
-, -l, --login
Starts the shell as login shell with an environment similar to a real login:
o clears all environment variables except for TERM
o initializes the environment variables HOME, SHELL, USER, LOGNAME, PATH
o changes to the target user's home directory
o sets argv[0] of the shell to '-' in order to make the shell a login shell
Note the first bullet point. This includes $DISPLAY.
Last edited by WorMzy (2012-12-04 21:08:42)
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
The DISPLAY=:0.0 didn't help.
Thanks in advance.
It should be DISPLAY=:0
Is your problem related to recent dbus update ? , I am not sure but there are some discussions going on . You may take a look at those.
Never argue with stupid people,They will drag you down to their level and then beat you with experience.--Mark Twain
@github
Offline
for god's sake, try gksu...
“The future has already arrived. It's just not evenly distributed yet.”
― William Gibson
Offline
for god's sake, try gksu...
LOL....
Never argue with stupid people,They will drag you down to their level and then beat you with experience.--Mark Twain
@github
Offline
When I start a terminal, I enter "su -"
When I try to open any file, or simply enter gedit, I get:
========================================
** (gedit:1216): WARNING **: Could not open X display
Cannot open display:
========================================
Can someone please help?Thank you.
sudo gedit
Acer TM B115-P5BB | intel video card |Seagate 500G 5400rpm AF 7.5mm | 2GB RAM | 2.5 GHz Pentium N3530 CPU
Offline
Can't a command like "sudo gedit" cause issues with the permissions on e.g. .ICEauthority changing? Or is this not a problem anymore?
All men have stood for freedom...
For freedom is the man that will turn the world upside down.
Gerrard Winstanley.
Offline
Can't a command like "sudo gedit" cause issues with the permissions on e.g. .ICEauthority changing? Or is this not a problem anymore?
oh. I see. Thinks a lot.
Acer TM B115-P5BB | intel video card |Seagate 500G 5400rpm AF 7.5mm | 2GB RAM | 2.5 GHz Pentium N3530 CPU
Offline
Offline
Pages: 1