Terminal cannot start GUI apps

Questions about applications and software
Forum rules
Before you post please read how to get help
Post Reply
markku2812
Level 1
Level 1
Posts: 3
Joined: Fri Feb 23, 2018 1:30 am

Terminal cannot start GUI apps

Post by markku2812 » Fri Feb 23, 2018 2:25 am

I've been using Linux Mint XFCE for years, current version is 17.3 "Rosa".
Yesterday I faced a weird problem. I cannot start any GUI apps from terminal as ROOT:
- I open terminal
- sudo su giving the password which is accepted
- type in eg. leafpad & enter

The indicator of hard disk starts to flash but the app won't open. But a task (in Task manager) takes 25% of CPU-time using hard disk and I even can't kill the task.
Apps starts fine as a normal user.

Same thing if I try to open a folder as root, in File Manager, Thunar 1.6.10. The folder won't open but Thunar starts to use the disk taking 25% of CPU-time. And this never ends, well, I waited half an hour...
Same thing with Update Manager. Click Install Updates, type in the password, all package items will be grayed (disabled) and then nothing happens. In Task Manager "synaptic" is taking 25% of CPU-time.

In every case the hard disk indicator is blinking heavily, no matter how long I wait. And tasks cannot be killed, just gives an error saying something about missing previledges.

So guys, what to do?

User avatar
catweazel
Level 17
Level 17
Posts: 7774
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Terminal cannot start GUI apps

Post by catweazel » Fri Feb 23, 2018 2:48 am

gksu ... instead of sudo su ...
¡uʍop ǝpısdn sı buıɥʇʎɹǝʌǝ os ɐıןɐɹʇsnɐ ɯoɹɟ ɯ,ı

markku2812
Level 1
Level 1
Posts: 3
Joined: Fri Feb 23, 2018 1:30 am

Re: Terminal cannot start GUI apps

Post by markku2812 » Fri Feb 23, 2018 3:02 am

catweazel wrote:
Fri Feb 23, 2018 2:48 am
gksu ... instead of sudo su ...
This doesn't help, same result. And I forgot to say, I run the File Manager & Update Manager without the terminal.

User avatar
Moem
Level 17
Level 17
Posts: 7230
Joined: Tue Nov 17, 2015 9:14 am
Location: The Netherlands
Contact:

Re: Terminal cannot start GUI apps

Post by Moem » Fri Feb 23, 2018 3:06 am

If you're in the habit of opening GUI applications with sudo and/or su, then you have most likely created permissions problems which are now giving you trouble. Graphical applications should always be started from a terminal with gksudo or gksu. Otherwise, any file they write to becomes owned by root and not by the user. The message you saw about missing privileges confirms that this is the case here.

I'm sure someone will be able to show you how to restore ownership of your files.
Image

If your issue is solved, kindly indicate that by editing the first post in the topic, and adding [SOLVED] to the title. Thanks!

markku2812
Level 1
Level 1
Posts: 3
Joined: Fri Feb 23, 2018 1:30 am

Re: Terminal cannot start GUI apps

Post by markku2812 » Fri Feb 23, 2018 3:29 am

Moem wrote:
Fri Feb 23, 2018 3:06 am
If you're in the habit of opening GUI applications with sudo and/or su, then you have most likely created permissions problems which are now giving you trouble. Graphical applications should always be started from a terminal with gksudo or gksu. Otherwise, any file they write to becomes owned by root and not by the user. The message you saw about missing privileges confirms that this is the case here.

I'm sure someone will be able to show you how to restore ownership of your files.
I don't have that habit but sometimes when I want to edit some conf-file needing root, I might do that, using leafpad. This "habit" has been working fine for years.
But using directly File or Update Manager won't work either.
Actually, first time I faced this problem was in File Manager when I tried to open a folder as root. And also this has been working fine before.

User avatar
Moem
Level 17
Level 17
Posts: 7230
Joined: Tue Nov 17, 2015 9:14 am
Location: The Netherlands
Contact:

Re: Terminal cannot start GUI apps

Post by Moem » Fri Feb 23, 2018 4:05 am

markku2812 wrote:
Fri Feb 23, 2018 3:29 am
But using directly File or Update Manager won't work either.
That makes sense, because the ownership of certain files in your home directory is now messed up no matter which application you try to use. I can't tell you how to check for ownership issues but I know other people will be along who can.
As for the word 'habit', once is enough. It doesn't matter how often. Just don't use 'sudo' or 'su' with graphical applications, ever. That is what 'gksudo' is for.
Image

If your issue is solved, kindly indicate that by editing the first post in the topic, and adding [SOLVED] to the title. Thanks!

rene
Level 8
Level 8
Posts: 2371
Joined: Sun Mar 27, 2016 6:58 pm

Re: Terminal cannot start GUI apps

Post by rene » Fri Feb 23, 2018 4:51 am

To find all files in your home directory not owned by your regular user, execute as said regular user,

Code: Select all

find ~/ -xdev ! -user $(whoami)
If satisfied that the displayed files should indeed be reowned, you can do so with

Code: Select all

find ~/ -xdev ! -user $(whoami) -print0 | xargs -0 sudo chown $(whoami):

Post Reply

Return to “Software & Applications”