2

Basically what the title says. Apparently, gedit does not have any permission to write even on basic text files which have all the permissions needed. In fact, other IDES/text editors (such as Atom or LibreOffice) can open and modify such files without any problem. I've tried to troubleshoot but I'm unable to fix the problem. I tried reinstalling and upgrading it, but id didnt't solve the issue. Executing Gedit as sudo does work, but the point would be not to go superuser to read/write simple readme files on Documents. Worst case i think I could just use ATOM as my main text editor, but I'd like to keep Gedit for quick changes in simple text files.

For example, I'm trying to read a file called "Qiime2_notes.txt".

$ ls -l
total 36
-rw-r--r-- 1 administrador administrador   164 de ma 20 10:52 Humann-notes.txt
-rw-r--r-- 1 administrador administrador  7697 d’abr  9 11:54 notes.txt
-rw-r--r-- 1 administrador administrador   281 de ma  4 17:56 Qiime2_automation_draft
-rwxrwxr-x 1 administrador administrador 19906 d’abr  9 13:02 Qiime2_notes.txt

I try to open it with gedit:

gedit Qiime2_notes.txt

and it opens the file without any error warning, but I can't write, select or save the text.

Basically as if I hadn't got any permission to modify the text:

ss

however, when I open it with sudo gedit Qiime2_notes.txt, it works perfectly.

Now I can perfectly modify the file:

ss

however, opening it with atom Qiime2_notes.txt it works perfectly without sudo.

Any idea why is this happening?

Pablo Bianchi
  • 15,657
cblabo
  • 21
  • Did you try running gedit from command line? For example, gedit .bashrc Is there any error message displayed? – FedKad Jun 12 '19 at 16:06
  • And you cannot save a changed version of .bashrc??? – FedKad Jun 12 '19 at 16:12
  • It works just as openning it from the graphical menu. it reads the document but without any permission (can't scroll, write nor save). Also typing only gedit opens a window but I can write anything, not even by opening a new file. However, non of that happens if I open it as sudo Gedit ~/Documents/sometext.txt – cblabo Jun 12 '19 at 16:14
  • Can you try from another (possibly freshly created) Linux user? – FedKad Jun 12 '19 at 16:15
  • Please [edit] your question and show us the output of ls -l badFile, (where badFile is one of the files you have this issue with). Then, open the file with gedit badFile from a terminal and show us any error messages you get. Finally, try mv ~/.config/gedit/ ~/.config/gedit.old and try opening gedit again. – terdon Jun 12 '19 at 16:16
  • I tried doing mv ~/.config/gedit/ ~/.config/gedit.old but it doesn't work. I'll try opening it with another user. – cblabo Jun 12 '19 at 16:36
  • What account are you logging into? Administrator? – heynnema Jun 12 '19 at 16:55
  • 3
    Running sudo gedit some-file might change the ownership of the configuration file(s) of gedit in your home directory (root might own the file). When that happens you will have problems running gedit as the normal user ID. You can change the ownership back of {that file/those files} and make things work again. Next time, remember to user sudo -H gedit some-file; use sudo -H with GUI application programs, or some other method described at this link. – sudodus Jun 12 '19 at 17:02
  • I tried creating a new user (with access to root) and nothing, gedit is still incapable of editing files outside of sudo. I checked all the Gedit configuration files (the gedit file in /usr/bin, the /ibus file and everything I could find), changed them to my user (Administrador is just the name od the user, but it doesn't have any special permissions) and nothing. The weird thing is both Atom and Geanny have the same permissions and work perfectly fine. – cblabo Jun 13 '19 at 10:44
  • Did you try to purge and reinstall gedit? Did you check the gedit executable itself having strange ownership and setuid / setgid permissions? – FedKad Jun 15 '19 at 12:01
  • I am running 3.28. I have exactly the same issue. But mine might be related to a minimal gnome install I did for headless machine. I am guessing that such an unbundled install missed some dependency or setup. Kinda weird though. Sadly I've not been able to track down a solution anywhere else. This was the first post that fit my issue exactly. – DKebler Mar 07 '20 at 05:16

1 Answers1

0

I suspected it was a dconf issue and what ended up solving it for me was paying attention to the error I was getting when launching from the command line.

(gedit:2498): dconf-WARNING **: 22:15:51.286: unable to open named profile (ibus): using the null configuration.

After a bit of reading on dconf I realized my install had no profile folder in /etc/dconf/profile which kinda makes sense since it was a non-standard install So I made it and then created a profile file ibus in which i put

user-db:user
system-db:ibus

using of course another editor :-).

according to docs the first line will point to your userspace dconf user profile https://developer.gnome.org/dconf/unstable/dconf-overview.html

according to my environment my DCONF_PROFILE=ibus by default so it looked for that now existing profile and loaded it. The warning went away and now the editor edits! Apparently without a r/w place for dconf settings gedit goes into ready only.

if the DCONF_PROFILE environment var is unset then according to the docs dconf/gsetting will use the user profile in user space by default thus bypassing what I did above. One can do that by deleting the file /etc/profile.d/set-dconfg-profile.sh

Since this was not a gedit specific fix I imagine it might cure a few issues with other gnome/gsetting apps.

so if the op still has this issue maybe they can check to see if they have this missing profile and create i, or otherwise set the DCONF_PROFILE by error.

DKebler
  • 153