1

I use to have a setup that i could edit and save a file using (Kate text editor) that needed sudo privilage. On save it will show a dialog asking me for my password. This was really handy. But it is not working anymore. Now i get an error that the document could not be saved.

The goal for me is that i can double click on any text file that opens with Kate. And when i save it, it will prompt a password dialog when needed.

Does anybody has an idea how to get the dialog back that is asking for my password?

I'm using Kubuntu 16.04. My Kate version is: 16.04.3

enter image description here

$ lsb_release -a
No LSB modules are available.                                                                                                       
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.5 LTS
Release:        16.04
Codename:       xenial

This happend when i was trying to save .bashrc in my home folder.

drwxr-xr-x  137 billy billy     36864 Oct 16 13:43 .
drwxr-xr-x    5 root  root       4096 Feb 17  2018 ..
-rw-r--r--    1 root  root       9907 Sep 24 21:28 .bashrc

But it seems to happen with all files that i need sudo for.

Kind regards, Billy

11
  • When i do: ~$ kate -v
    – Barry
    Oct 16, 2018 at 14:57
  • output: kate 16.04.3
    – Barry
    Oct 16, 2018 at 14:59
  • I thought that is would be the version that i'm running at the moment?
    – Barry
    Oct 16, 2018 at 14:59
  • Where did you obtain it? The version I find in the repositories for 16.04 is kate 15.12.3
    – Elder Geek
    Oct 16, 2018 at 15:12
  • Just thru updates: sudo apt update && sudo apt upgrade -y && sudo apt dist-upgrade -y && sudo apt autoremove -y && sudo apt autoclean -y
    – Barry
    Oct 16, 2018 at 15:22

1 Answer 1

1

You haven't mentioned your distro! I'm assuming you're on Kubuntu 18.04 which has Kate Version 17.12.3.

Open a terminal, move to the folder containing the file you want to edit. In this example, I want to edit the gtkrc file located in /usr/share/themes/Crux/gtk-2.0/.

So, first

cd /usr/share/themes/Crux/gtk-2.0/

Then run SUDO_EDITOR=kate sudoedit gtkrc exactly as typed including the _ between SUDO and EDITOR.

/usr/share/themes/Crux/gtk-2.0 $ SUDO_EDITOR=kate sudoedit gtkrc

On pressing Enter, provide your password and press Enter. Kate will open the file. Make your edits and save as usual. Done.

When Plasma 5.13 arrives, you'll be able to open any suitable file with Kate and edit it. When you attempt to save it, you'll be prompted to provide your password if you've edited a system file.

7
  • Thank you for your answer. I'm using Kubuntu 16.04. I have also added the distro to the question. I don't have the Crux theme. I use Breeze-dark.
    – Barry
    Oct 16, 2018 at 10:56
  • I have tried this in the Default theme folder and in the Breeze-dark folder. But i don't seem to get this working i think.
    – Barry
    Oct 16, 2018 at 11:00
  • Well, I don't know what else to suggest because you aren't explaining what you mean by "i don't seem to get this working". Do you mean the editing and saving didn't work or that the edit you made didn't have the desired visual result? The Crux theme was an example :)
    – DK Bose
    Oct 16, 2018 at 11:10
  • Sorry, when i run "SUDO_EDITOR=kate sudoedit gtkrc" in that folder. Enter my password, Kate opens, that file. I am able to save this file. But i don't understand what i should add or change in this file. I tried to add "SUDO_EDITOR=kate sudoedit gtkrc" in that file. But to be Frank, i don't know what i'm doing. Or it that even should be there. The goal for me is that i can double click on any text file that opens with Kate. And when i save it, it will prompt a password dialog when needed.
    – Barry
    Oct 16, 2018 at 11:55
  • 1
    Strange, i had exactly that working for a very long time. But i did a big cleanup of alot of packages last weekend. And it stopt working.
    – Barry
    Oct 16, 2018 at 14:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .