Announcement

Collapse
No announcement yet.

How to edit text files as Super User

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [SOLVED] How to edit text files as Super User

    Before I upgraded to 18.04, if i needed to edit e.g. a config file as a superuser, I would type
    Code:
    sudo kate <file name>
    Now when I type that it says this:
    Code:
    :~$ sudo kate /etc/resolvconf/resolv.conf.d/base
    Executing Kate as root is not possible. To edit files as root use:
    SUDO_EDITOR=kate sudoedit <file>
    :~$ SUDO-EDITOR=kate sudoedit /etc/resolvconf/resolv.conf.d/base
    SUDO-EDITOR=kate: command not found
    I also tried "sudoedit: /etc/resolvconf/resolv.conf.d/base", I get an old school text editor with nothing at all showing in the file, just like a blank .txt file.

    #2
    Open your file in Kate. Edit it. When you go to save it, you'll be prompted for your password if it's a file that needs elevated privileges.

    No need for sudo, gksudo, kdesudo, pkexec, etc.
    Kubuntu 20.04

    Comment


      #3
      Follow chimak111's post. But to answer the question as to why what you typed didn't work, you used a hyphen instead of an underscore in the error instructions.

      Executing Kate as root is not possible. To edit files as root use:
      SUDO_EDITOR=kate sudoedit <file>

      Note the red underscore in the command above.
      Using Kubuntu Linux since March 23, 2007
      "It is a capital mistake to theorize before one has data." - Sherlock Holmes

      Comment


        #4
        OK cool, thanks!

        Comment

        Working...
        X