5

Previously, I need to clear documents history, so I Googled and found this:

http://www.watchingthenet.com/ubuntu-tip-clear-disable-recent-documents.html

I did the step, and then when I opened gedit in root terminal, I've got this:

root@dellph1-desktop:/# gedit

(gedit:8224): GLib-CRITICAL **: g_bookmark_file_load_from_data: assertion `length != 0' failed

(gedit:8224): Gtk-WARNING **: Attempting to store changes into `/root/.recently-used.xbel', but failed: Failed to rename file '/root/.recently-used.xbel.FP7PPV' to '/root/.recently-used.xbel': g_rename() failed: Operation not permitted

(gedit:8224): Gtk-WARNING **: Attempting to set the permissions of `/root/.recently-used.xbel', but failed: Operation not permitted
root@dellph1-desktop:/# 

And it's happpened in user terminal:

dellph1@dellph1-desktop:~$ gedit

(gedit:9408): Gtk-CRITICAL **: gtk_accel_label_set_accel_closure: assertion `gtk_accel_group_from_accel_closure (accel_closure) != NULL' failed
dellph1@dellph1-desktop:~$ 

I really hope someone helps in this case, thank you.

dellphi
  • 355
  • 6
    Please don't use gedit as root, it's not cool. – Martin Owens -doctormo- Jan 23 '11 at 23:00
  • Previously, no problem. A warning message appeared after I used the steps suggested in the link above. What should I do? I've reinstall gedit, create the folder requested manually, but not solve the problem. Finally, I Googled again and found this http://ubuntuforums.org/showthread.php?t=1631433
    but the thread was solved by itself, and he did not know why things happen, weird ...
    – dellphi Jan 24 '11 at 04:21
  • @MartinOwens-doctormo- It's fine to run gedit as root so long as $HOME is root's home. – Eliah Kagan Jan 10 '13 at 23:35

2 Answers2

2

Use this

(nohup gedit 2>/dev/null &)

This runs gedit in the background in a sub-shell, with nohup. Hence, the error messages are handled by nohup, and closing the terminal wouldn't affect gedit. A simpler way would be:

gedit &> /dev/null

This just discards any error messages from gedit.

muru
  • 197,895
  • 55
  • 485
  • 740
1

I'm recommending that you not use gedit via the root user. Try and use gedit through sudo instead.

Reinstalling gedit won't help, I believe you need to undo the damage done by following the guide.

  • Until now, the problem is still there. Unlike the above thread that can be solved automatically. But I am confused to make the opposite of the previously recommended procedure. Thank you for helping. – dellphi Jan 28 '11 at 14:55
  • Owens: "gedit through sudo"? .. It should be run via gksudo .... and what do you mean by "..don't use gedit as root, it's not cool"... are you referring to "gedit" not being "cool" or running anything in Ubuntu as root is not "cool"? – Peter.O May 18 '11 at 07:51
  • gksu, sudo, pedant etc. – Martin Owens -doctormo- May 19 '11 at 16:56
  • 1
    Not pedantic - different things. Using sudo was throwing the same warning for me which lead me to this page. .... "You should never use normal sudo to start graphical applications as root. You should use gksudo (kdesudo on Kubuntu) to run such programs. gksudo sets HOME=/root, and copies .Xauthority to a tmp directory.This prevents files in your home directory becoming owned by root." ..... via http://askubuntu.com/questions/11760/what-is-the-difference-between-gksudo-nautilus-and-sudo-nautilus – Craicerjack Feb 26 '14 at 15:27