Saving a file in gedit prints a warning in terminal

36,733

Solution 1

  1. This is not critical, the metadata seems to be only the last line number you were on, so the file will reopen in the same position. You can check with gio info <path>.

  2. Don't sudo gnome apps. Use "admin://" schema to tell gedit that it needs to escalate. You'll get a graphical escalate prompt.

gedit admin:///etc/default/grub

Good explanation on the escalation mess here:

https://easylinuxtipsproject.blogspot.com/p/about-root.html

Solution 2

Whenever you want to open a GUI application with sudo privileges from the terminal CLI, you must use sudo -H, else you probably create a login loop.

sudo -H gedit /etc/default/grub

From man sudo we get the -H description...

-H, --set-home
             Request that the security policy set the HOME environment
             variable to the home directory specified by the target user's
             password database entry.  Depending on the policy, this may
             be the default behavior.

translated this means that if you don't use -H, these two files in your /home directory probably get changed to owner root:root, and you get a login loop...

-rw------- 1 your_username your_username 441K Nov  2  2019 .ICEauthority
-rw------- 1 your_username your_username   58 Jun 23  2017 .Xauthority

The warning messages... they're just noise.

And, you should never manually edit /boot/grub/grub.cfg.

Update #1:

To reduce the need to manually edit /boot/grub/grub.cfg, edit/add the following to /etc/default/grub...

GRUB_DEFAULT=saved    # this is an edit
GRUB_SAVEDEFAULT=true # this is an add

sudo update-grub # write changes

This will allow GRUB to remember the last selected OS to boot, and will reboot to that same OS until a different OS is selected.

Solution 3

Having gvfs installed does not prevent the error message. In my own case, "gvfs is already the newest version (1.44.1-1ubuntu1)" but the error still pops up warning whenever I "gedit" a document, either with 'sudo gedit' or 'sudo -H gedit'. I have not found a clear direction on how to fix that tepl issue, my system works great, the warning comes only when using 'sudo gedit'.

However, I found a workaround that goes like this somewhere and 'sudo gedit' gives no errors or warnings:

" Alternatively you can put: export SUDO_EDITOR='/usr/bin/gedit -w' in your .bashrc file and then you can just do this to edit the file: sudoedit /etc/default/grub "

Solution 4

I have only ubuntu 20.04, no multiboot, updated pkgs, sudo gedit and sudo -H gedit both continue to spew Tepl warnings, mostly re GVfs metadata.
the answering parties above have not addressed that issue, nor that it was not an issue until 20.04. from scanning pkgs, 20.04 uses 'libtepl-4-0' whose description via apt show is:

Description: Text editor library for GTK

Tepl is a library that eases the development of GtkSourceView-based text editors and IDEs. Tepl is the acronym for “Text editor product line”. It serves as an incubator for GtkSourceView.

guess the error msg hint to config tepl may do the trick, if only it included which file to config, instead of just the options to apply! :)

Share:
36,733

Related videos on Youtube

Abhay Patil
Author by

Abhay Patil

Updated on September 18, 2022

Comments

  • Abhay Patil
    Abhay Patil over 1 year

    I recently installed a GRUB theme from gnome-look.org on Ubuntu 20.04 LTS (my PC is Windows 10 dual-boot with Ubuntu). To install the theme successfully, the file at /etc/default/grub needs to be edited.

    So I used sudo gedit /etc/default/grub command to do so. After editing when I save it I, see the following warning in Terminal:

    enter image description here

    (gedit:7169): Tepl-WARNING **: 21:13:18.135: GVfs metadata is not supported. Fallback to TeplMetadataManager. Either GVfs is not correctly installed or GVfs metadata are not supported on this platform. In the latter case, you should configure Tepl with --disable-gvfs-metadata.
    

    Later on I also edited the grub menu by editing the file at /boot/grub/grub.cfg by using sudo gedit /boot/grub/grub.cfg.

    Upon saving the file I got a similar warning

    enter image description here

    (gedit:8887): Tepl-WARNING **: 21:18:46.163: GVfs metadata is not supported. Fallback to TeplMetadataManager. Either GVfs is not correctly installed or GVfs metadata are not supported on this platform. In the latter case, you should configure Tepl with --disable-gvfs-metadata.
    

    Can someone tell me the reason? And also how to deal with it?

  • Abhay Patil
    Abhay Patil about 4 years
    But why is sudo -H needed? And what is the problem with just sudo?
  • schrodingerscatcuriosity
    schrodingerscatcuriosity about 4 years
    Or nano, which doesn't require learning the vim/emacs' intricacies.
  • Abhay Patil
    Abhay Patil about 4 years
    I just use it to change the boot order. By default Ubuntu is above Windows and also there is an option for opening BIOS in boot menu. So I just remove the BIOS and shift Windows above Ubuntu. Also I change Windows Boot Manager to Windows
  • Boris Hamanov
    Boris Hamanov about 4 years
    @AbhayPatil There's a better way to do this.
  • Abhay Patil
    Abhay Patil about 4 years
    What is the better way?
  • Boris Hamanov
    Boris Hamanov about 4 years
    @AbhayPatil See Update #1 in my answer.
  • koyakun
    koyakun about 4 years
    I get the same error when using sudo -H gedit. This is after upgrading to 20.04. It did not happen on 19.10
  • Abhay Patil
    Abhay Patil about 4 years
    @heynnema in edit 1, how to select different OS? Would the grub loader still be shown?
  • Abhay Patil
    Abhay Patil about 4 years
    As @koyakun pointed, it might be an issue with 20.04, because I still get that error
  • Boris Hamanov
    Boris Hamanov about 4 years
    @AbhayPatil If you had had the GRUB menu before, you'll still have it after implementing Update #1 in my answer. To select a different OS, do as you do now, use the up/down arrow keys to select a different OS, then hit ENTER. It'll remember that choice until the next time you select a different OS. Also, the warning errors that you see have nothing to do with sudo -H, right now, they're just noise.
  • koyakun
    koyakun about 4 years
    What is the question being answered here? "Why does the error message appear?" "How do I avoid the error message?" or "How to edit grub?" The title at the top of the page seems to suggest either of the first two, not the latter.
  • Abhay Patil
    Abhay Patil almost 4 years
    @koyakun "Why does it occur?" and "How to deal with it?".
  • Boris Hamanov
    Boris Hamanov almost 4 years
    @AbhayPatil As I mention in my answer, the warning messages are just noise. Just ignore them (for now). Gedit has some problem with metadata.
  • v2r
    v2r almost 4 years
    Also you could use "nano" or "vim" - editor (sudo required) in your terminal window in order to edit text-based system files.
  • Boris Hamanov
    Boris Hamanov over 3 years
    @v2r Of course, you're also correct... however, if you read the original question, the user was using sudo gedit, and hence my answer instructed the user of the proper use of sudo -H when using a GUI app like gedit.
  • brec
    brec over 2 years
    sudo gedit -w is as easy to type and just as easy to remember as SUDO_EDITOR. But -w works for me so I am upvoting this answer!
  • Mike Wise
    Mike Wise about 2 years
    I am getting this error in WSL without using sudo
  • Tamir Daniely
    Tamir Daniely about 2 years
    WSL is a completely different story, you probably want to post a different question specifically for wslg. But on general it means that either wslg isn't running gvfs. or that there's some bug in the integration.