2

When I use gedit in Ubuntu 20.04, whenever I click on any of the checkboxes in Preferences, nothing happens.

Preferences

For example, when I click on Display line numbers, the checkbox is still marked as checked. For some reason, clicking Display grid pattern, Enable text wrapping, and Do not split words over two lines works, but when I exit out of Preferences and come back in, they go back to their original status, as shown in the picture.

All other options in other tabs can not be changed.

Edit: Apparently Preferences works when using gedit as a normal user, and not root. Previously, I was trying to change the Preferences as root

Now, I wonder why Preferences can not be changed as root. I noticed that when I use gedit as a normal user, nothing pops up at the terminal, but when I open gedit as root, the following message is displayed in the terminal:

(gedit:2024): dconf-WARNING **: 21:01:08.260: failed to commit changes to dconf: The connection is closed

(gedit:2024): dconf-WARNING **: 21:01:08.270: failed to commit changes to dconf: The connection is closed Error creating proxy: The connection is closed (g-io-error-quark, 18) Error creating proxy: The connection is closed (g-io-error-quark, 18) Error creating proxy: The connection is closed (g-io-error-quark, 18) Error creating proxy: The connection is closed (g-io-error-quark, 18) Error creating proxy: The connection is closed (g-io-error-quark, 18)

(gedit:2024): dconf-WARNING **: 21:01:08.509: failed to commit changes to dconf: The connection is closed

(gedit:2024): dconf-WARNING **: 21:01:08.509: failed to commit changes to dconf: The connection is closed

(gedit:2024): dconf-WARNING **: 21:01:08.510: failed to commit changes to dconf: The connection is closed XDG_RUNTIME_DIR (/run/user/1000) is not owned by us (uid 0), but by uid 1000! (This could e.g. happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don't do that.) XDG_RUNTIME_DIR (/run/user/1000) is not owned by us (uid 0), but by uid 1000! (This could e.g. happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don't do that.)

(gedit:2024): dconf-WARNING **: 21:04:00.840: failed to commit changes to dconf: The connection is closed XDG_RUNTIME_DIR (/run/user/1000) is not owned by us (uid 0), but by uid 1000! (This could e.g. happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don't do that.) XDG_RUNTIME_DIR (/run/user/1000) is not owned by us (uid 0), but by uid 1000! (This could e.g. happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don't do that.)

  • This is mostly a stab in the dark, but can you try sudo apt install --reinstall gedit? Beyond that, I'd be curious about permissions. But, I'd start here. – KGIII Aug 12 '20 at 01:19
  • Reinstalling does not have any effect. – user1046658 Aug 12 '20 at 01:25
  • Yeah, that was kinda a stab in the dark. I'd start checking permissions next. I did some looking, after replying, and it appears you might be able to change some settings via the terminal. See this link here. If they don't change as a normal user, try changing them with sudo and if that works then it's probably some permissions issue. Probably... I'm more a leafpad user than a gedit user. – KGIII Aug 12 '20 at 01:31
  • Thanks and also, what do you mean by permissions? – user1046658 Aug 12 '20 at 01:39
  • Well, everything in Linux is a file and all files have permissions. These permissions decide who or what account can read, write, or execute them. For example, when you use the 'sudo' command, you're temporarily elevating your account's permissions to read/write/execute a file. If you can't change your preferences, one (or more) of the directories (or files) may have the wrong permissions - meaning you, your account, doesn't have rights to make changes to those files. Make sense? – KGIII Aug 12 '20 at 01:49
  • Oh, I am doing everything as root, so Preferences should be able to be changed – user1046658 Aug 12 '20 at 01:58
  • You can try that. I'd NOT make it a habit of running it as root - and running it as root may mean that gedit saves the settings into 'roots' profile. But, sure... Start it as 'sudo gedit' and see if you can change the preferences. That's another good way to see if it's a permissions issue. If it is a permissions issue, you'll have to find all the appropriate folders/binary files and ensure they're set properly. – KGIII Aug 12 '20 at 02:01
  • Apparently Properties works fine when editing a file as a normal user, but does not work as root. Any idea as to why this happens? (I have added something in my question because there is a message that is displayed when I use gedit as root, which does not happen when I use gedit as a normal user) – user1046658 Aug 12 '20 at 04:06
  • How are you starting gedit as root? With sudo gedit filename? – heynnema Aug 12 '20 at 17:16

1 Answers1

1

When starting a GUI application, like gedit, using sudo, you must use sudo -H, like so:

sudo -H gedit /path_to/filename
heynnema
  • 70,711