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.

3
  • 6
    Please don't use gedit as root, it's not cool. Jan 23, 2011 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, 2011 at 4:21
  • @MartinOwens-doctormo- It's fine to run gedit as root so long as $HOME is root's home. Jan 10, 2013 at 23:35

2 Answers 2

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.

1
  • 4
    Welcome to Ask Ubuntu! I recommend editing this answer to explain what this does. Dec 31, 2012 at 1:08
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.

4
  • 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, 2011 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, 2011 at 7:51
  • gksu, sudo, pedant etc. May 19, 2011 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/… Feb 26, 2014 at 15:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .