I got a strange problem with kate
editor.
For some reason, whenever I runs kate
in normal mode (without sudo
) then all kate plugins disappear. I could not see any Projects/FileSystemBrowser/Documents that I normally use.
But when I run kate
with sudo
then those plugins show up, albeit the look-and-feel looks odd (with all the borders, etc.).
I tried to uninstall and reinstall kate altogether, but the problem still persists. It looks like I have two different kate
installed, the look-and-feel looks different as well when running with/without sudo
.
Oh and before I can just type kate <document_name>
and it would show up nicely in a new tab. Now it doesn't work that way, opening a whole new windows instead (not new tab).
Any suggestion to fix this issue would be appreciated – thanks.
Edit 1:
I have two Ubuntu 14.04 machines, and this happens with just one machine. Ironically it happens with the machine that I use most of the time (not with the secondary machine). Could it be the kate config is different somehow, or if the config is corrupted?
Edit 2:
I can't recall exactly when the problem happens. But certainly sometimes after upgrading Ubuntu 12.04 to 14.04. But again, I upgraded both of my machines in almost the same way.
Edit 3:
On the machine that kate
works ok:
$ ll ~/.kde/share/config
total 160
drwxrwxr-x 2 test test 4096 Aug 3 17:51 ./
drwxrwxr-x 5 test test 4096 Mar 4 2014 ../
-rw------- 1 root root 66 Dec 5 2014 drkonqirc
-rw------- 1 test test 174 Mar 19 10:47 katepartpluginsrc
-rw------- 1 test test 9075 Aug 3 17:51 katerc
-rw------- 1 test test 35 Feb 12 16:20 kateschemarc
-rw------- 1 test test 3877 Feb 12 16:18 katescriptingrc
-rw------- 1 test test 66067 Jun 16 09:38 katesyntaxhighlightingrc
-rw------- 1 test test 901 Dec 5 2014 kconf_updaterc
-rw------- 1 test test 104 Dec 5 2014 kcookiejarrc
-rw------- 1 test test 328 Jun 16 09:38 kdebugrc
-rw------- 1 test test 39 Mar 4 2014 kdedrc
-rw------- 1 test test 473 Mar 4 2014 kdeglobals
-rw------- 1 test test 69 Mar 4 2014 kio_httprc
-rw------- 1 test test 92 Mar 4 2014 kioslaverc
-rw------- 1 test test 35 Mar 4 2014 knfsshare
-rw------- 1 test test 402 Mar 4 2014 komparerc
-rw------- 1 test test 122 Jun 16 09:38 ktimezonedrc
-rw------- 1 test test 88 Dec 5 2014 kuriikwsfilterrc
-rw------- 1 root root 48 Dec 5 2014 kwalletrc
-rw------- 1 test test 85 Mar 4 2014 nepomukserverrc
-rw------- 1 test test 22 Mar 4 2014 phonondevicesrc
On the machine that kate
doesn't work ok (with the described strange behaviours):
$ ll ~/.kde/share/config
total 188
drwxrwxrwx 3 test test 4096 Aug 4 08:37 ./
drwxrwxrwx 5 test test 4096 Feb 12 09:36 ../
drwxrwxrwx 2 test test 4096 May 22 10:22 colors/
-rwxrwxrwx 1 test test 151 Jul 30 11:34 drkonqirc*
-rwxrwxrwx 1 test test 259 Apr 28 15:05 katepartpluginsrc*
-rwxrwxrwx 1 test test 2098 Feb 12 09:36 katepartscriptrc*
-rwxrwxrwx 1 test test 24686 Aug 4 08:37 katerc*
-rwxrwxrwx 1 test test 96 May 21 16:43 kateschemarc*
-rwxrwxrwx 1 test test 3877 Apr 28 09:38 katescriptingrc*
-rwxrwxrwx 1 test test 66416 Jul 28 13:38 katesyntaxhighlightingrc*
-rwxrwxrwx 1 test test 1148 Jul 31 13:28 kconf_updaterc*
-rwxrwxrwx 1 test test 104 Apr 28 09:38 kcookiejarrc*
-rwxrwxrwx 1 test test 442 Jul 30 11:34 kdebugrc*
-rwxrwxrwx 1 test test 39 Feb 12 09:36 kdedrc*
-rwxrwxrwx 1 test test 574 Jul 30 17:30 kdeglobals*
-rwxrwxrwx 1 root root 88 Jul 24 16:29 kglobalshortcutsrc*
-rwxrwxrwx 1 test test 69 Feb 12 09:36 kio_httprc*
-rwxrwxrwx 1 test test 92 Feb 12 09:36 kioslaverc*
-rwxrwxrwx 1 test test 35 Mar 23 16:04 knfsshare*
-rwxrwxrwx 1 root root 56 Jul 24 16:29 konsolerc*
-rwxrwxrwx 1 test test 122 Mar 23 16:04 ktimezonedrc*
-rwxrwxrwx 1 test test 88 Apr 28 09:38 kuriikwsfilterrc*
-rwxrwxrwx 1 test test 48 Apr 28 09:38 kwalletrc*
-rwxrwxrwx 1 test test 85 Feb 12 09:36 nepomukserverrc*
-rwxrwxrwx 1 test test 22 Feb 12 09:36 phonondevicesrc*
Edit 4: Quick fix
Following Lekensteyn's hints, I compared these two config folders. They in fact look very different. As a first step, I backed up the config
folder in the machine that doesn't work, then copy the one from the other machine over. And now kate
seems to work ok. I'm monitoring it now.
Obviously this doesn't look like a proper fix yet, but at least it appears working for now.
What still baffles me is why that config
folder has all those wrong permissions, even after a fresh install. Anyway that should not be in the scope of this Q – as long as kate
works stably with all those plugins – that's all I need.
Best Answer
You should not run kate with
sudo
, that leads to such issues. Instead, usekdesu kate
.Now, assuming that some permissions in your home directory got messed up, use this command to find all files in your home directory that are not owned by you (
sudo
is added in case you have a directory that is inaccessible by your user due to insufficient permissions,$USER
is normally expanded by the shell to the current user):You can then manually
sudo chown $USER: your-file
or fix it immediately while runningfind
(be careful not to have typos in this command):Note the
:
after$USER
, it results inchown
changing the group of the file to the primary group of user$USER
(which is typically, but not always, the same).