4

Looking for an alternative to gksudo in Debian, I stumbled upon this article, which suggests to use the admin:// prefix in order to access files as root. E.g. instead of

gksu gedit /etc/default/apport

one is supposed to run

gedit admin:///etc/default/apport

I don't use gedit, but running leafpad admin:///etc/fstab on my Debian Buster simply opens an empty file. What am I missing?

mtp:// is working on that machine, so I suppose GVFS support is present.

  • 1
    I'm pretty sure that's a gedit or at least GNOME-specific thing. GNOME has a lot of extended capabilities around file paths. I've never heard of it in any other context. Someone who knows should actually answer though. – davolfman Nov 03 '21 at 16:08

1 Answers1

8

admin: is one of GVfs’ schemes. It is only usable in editors (and other applications) which support GIO/GVfs; this is one reason why gedit is typically used in examples.

As far as I can tell Leafpad doesn’t support GIO, so it can’t use admin:.

See also How to properly edit system files (as root) in GUI (and CLI) in Gnu/Linux?

Stephen Kitt
  • 434,908