23

I have upgraded 14.04 to 16.04 . Now I am trying to open the gedit from terminal by passing the command:

sudo gedit /some/where/file.txt

but it is throwing an error stating that:

(gedit:2090): Gtk-WARNING : Calling Inhibit failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown:
  The name org.gnome.SessionManager was not provided by any .service files**

However, it is opening the file. When I try to save any modification then it is showing this error after saving the file:

(gedit:2090): WARNING : Set document metadata failed: Setting attribute metadata::gedit-position not supported

I am not getting why this is happening in 16.04 only; it was not on 14.04.

Zanna
  • 70,465
alok_007
  • 331

4 Answers4

8

You can stop seeing this behavior simply by launching gedit from the launcher rather than the command line as was intended.

If you indeed require an editor that you can launch from the command line without seeing these errors, you might try nano or pico(a simple to use editor) launched from the command line or vi (a more advanced editor) also launched from the command line.

for more info on these editors see man nano or man vi respectively.

Most people love one and hate the other but you have the freedom to choose

Source: Experience

Elder Geek
  • 36,023
  • 25
  • 98
  • 183
5

You can ignore those warnings. If it bothers you, just type:

sudo -H gedit /some/where/file.txt &>/dev/null
einpoklum
  • 871
  • 3
  • 10
  • 28
  • And how to configure things to permanently stop seeing them? – Quidam Apr 24 '20 at 13:52
  • the warnings are part of gedit. you can write a shell script gedit in the path before the original gedit and do the redirect of the output. I dont believe there are other ways, just this or a similar workaround – U.V. Nov 25 '21 at 11:22
0

enter image description here

In my case, I was able to remove it by putting &>/dev/null on similar warnings.

-1

Hay every one, I have solved this issue with typing like this command:

sudo gedit //some/where/file.txt

It means you should put one / before typing file address