1

When I am trying to edit some files I am getting this warning. How can I resolve this error.

(gedit:5596): IBUS-WARNING **: The owner of /home/user/.config/ibus/bus is not root!
Zanna
  • 70,465
  • 6
    that happens when you run sudo gedit, which you should avoid. Use sudo -i then gedit and remember to exit at the end, if you actually need to use gedit with root privileges – Zanna Dec 08 '16 at 22:42

2 Answers2

5

If you want to not see the error, try sudo -i gedit in the future.

You are attempting to run gedit via sudo without inheriting the root user's environment settings and are instead using them from the current user. The current user is not root and root is not running ibus, so you definitely should be seeing that error.

Stephen
  • 1,797
  • sudo -i gedit didn't work. Does it change the directory? On the other hand gksu gedit and pkexec gedit did work. I ran all three commands from within the user's home directory on the same file. – WinEunuuchs2Unix Dec 10 '16 at 00:05
1

The problem with the one answer recommending "sudo gedit" is technically incorrect. You need to use "gksu ..." for graphical environments (GUI).

gksu gedit some_file_name

and

gksu nautilus /some_directory

are the accepted standards.

Starting with Ubuntu 17.04 you should use pkexec instead of gksu.

  • 1
    No, sudo -i is perfectly fine for GUI applications. The problem with plain sudo is that it does not reset some environment variables, causing problems. sudo -i gives a clean root environment. – muru Dec 09 '16 at 00:58
  • @muru I didn't reference sudo -i in my answer as I saw the one without I'll change it from two to one... Thanks. – WinEunuuchs2Unix Dec 09 '16 at 01:10
  • gksu is already deprecated (although fine to use) and not installed by default. pkexec requires configuration. sudo -i is probably best, but my question is still waiting for a good answer... – Zanna Dec 09 '16 at 10:54
  • 1
    @Zanna A chevron to your question which is a great one. Personally I use a script called gsu that calls pkexec and writes a record to a log file of every file edited. The log file will hopefully help me migrate code changes to new installs down the road. – WinEunuuchs2Unix Dec 09 '16 at 11:30
  • Thanks for the chevron :) sounds like a useful script :D – Zanna Dec 09 '16 at 12:31