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


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

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

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

  • 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 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 4: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

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.

| improve this answer | |
  • 4
    Welcome to Ask Ubuntu! I recommend editing this answer to explain what this does. – Eliah Kagan Dec 31 '12 at 1:08

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.

| improve this answer | |
  • 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 7: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 askubuntu.com/questions/11760/… – Craicerjack Feb 26 '14 at 15:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.