2

Ive tried using sudo gedit <filename> but the terminal spits out "The owner of /home/user/.config/ibus/bus is not root!" as it opens gedit. Then when I try to save from gedit it comes up with an error at the top saying "could not save the file Unexpected error: Error writing to file: input/output error"

Daniel
  • 21

1 Answers1

1

The simplest solution is to use sudoedit or sudo -e after adding your username to the newsudo group w/ sudo usermod -a -G newsudo yourusername .

The classic answer you will find all over the web is to use gksudo or gksu to open a graphical editor, such as gedit. However, gksudo and gksu are depreciated and no longer included with Debian and its derivatives, such as Ubuntu and Mint, as noted by ItsFOSS and the previous web link.

Nautilus Admin or PolicyKit can be used, as Bodo kindly noted above in Comments, if you are adamant you must have a graphical editor.

K7AAY
  • 3,816
  • 4
  • 23
  • 39
  • I used sudo nano <filename> and when it opened it showed that the document is blank. I copied the short file into the editor and made my changes, then when I went to save "[ Error writing : Permission denied ]" popped up on the bottom of the screen. – Daniel Jul 22 '19 at 21:13
  • Hm, I can edit other files in the same directory(which are also read only), but for some reason the one file I want to edit won't open properly in nano. – Daniel Jul 22 '19 at 21:14
  • @Daniel I suggest to show the command ls -l <filename> with its output in your question. – Bodo Jul 23 '19 at 09:41
  • 1
    Please don’t suggest running an editor as root, it’s better to use sudoedit — and it can be set up to use a graphical editor, without requiring PolicyKit configuration. – Stephen Kitt Jul 23 '19 at 13:14
  • Point well taken, answer revised accordingly. – K7AAY Jul 23 '19 at 15:19