5

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.

  • 1
    Try fix its config permissions sudo chown username:username /home/username/.config/kate* (change username with your own) then run it without sudo . Btw avoid running GUI tools using sudo use gksudo instead. – user.dz Jul 31 '15 at 4:31
  • 1
    @Sneetsher: I couldn't find any kate entry in my /home/<myuser>/.config. Is there any reason for this? thanks. – artm Jul 31 '15 at 4:40
  • 1
    Check the permissions of parent folder sudo stat /home/<username>/.config – user.dz Jul 31 '15 at 5:01
  • 1
    Here's what I've got. I don't recall changing any of these - should I change the permissions the whole .config folder (I still don't find kate entry in that folder). ~$ sudo stat /home/artm/.config File: ‘/home/artm/.config’ Size: 4096 Blocks: 8 IO Block: 4096 directory Device: 805h/2053d Inode: 11796500 Links: 30 Access: (0700/drwx------) Uid: ( 1000/ artm) Gid: ( 1000/ artm) Access: 2015-07-31 14:38:02.882169403 +1000 Modify: 2015-06-25 12:04:20.694407173 +1000 Change: 2015-06-25 12:04:20.694407173 +1000 Birth: - – artm Jul 31 '15 at 5:11
  • 1
    It is ok! permissions are correct – user.dz Jul 31 '15 at 5:50
6
+50

You should not run kate with sudo, that leads to such issues. Instead, use kdesu 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):

sudo find ~ ! -user $USER -ls

You can then manually sudo chown $USER: your-file or fix it immediately while running find (be careful not to have typos in this command):

sudo find ~ ! -user $USER -ls -exec chown $USER: {} \;

Note the : after $USER, it results in chown changing the group of the file to the primary group of user $USER (which is typically, but not always, the same).

| improve this answer | |
  • 1
    Thanks. I just tried your first command kdesu kate on my Ubuntu 14.04, it just says kdesu: command not found. Do I need to install some other package? It's just strange as kate worked ok, and all of a sudden I got these issues. The only thing I can think of is that it happens sometimes after upgrading from 12.04 to 14.04. But I don't recall that it happens immediately after upgrading, it seems more like recently. – artm Aug 2 '15 at 22:52
  • 1
    Looks like Ubuntu calls it kdesudo. Can you post a screenshot with the differences between your two installations? The KDE settings are stored in ~/.kde/share/config/kate* (files prefixed with kate). You can use something like kdiff3 ~/.kde/share/config/katepartpluginsrc your-other-katepartpluginsrc to look for differences. – Lekensteyn Aug 3 '15 at 8:02
  • 1
    I've updated the Q as you suggested. Kate seems to be working for me now, I'm working with it to see if there is anything weird after copying over the config folder from the other machine. Thanks. – artm Aug 4 '15 at 4:04
  • 1
    @artm Your permissions are messed up, no file in that config folder should be executable, and everything should be owned by you. Try this to correct the ownership and make it not executable and world-writable: sudo chown -R test: ~/.kde4/share/config/ && chmod -R a-x,+X,o-w. For further debugging I suggest you to run kate from a konsole and watch its output for hints (compare the outputs between your two machines). – Lekensteyn Aug 4 '15 at 10:46
  • 1
    Thanks @Lekensteyn. I have no ideas why the permissions on that config folder had messed up in the first place. And also no idea why it's still there after I uninstalled it using sudo apt-get autoremove and sudo apt-get --purge remove, then reinstalled it again. Anyway when I just copied it from one machine to another, then now it seems working ok (I used it for a day without issues). – artm Aug 5 '15 at 23:12
2

You could try reinstall Kate from the terminal:

  sudo apt-get install --reinstall Kate

and the reconfigure Kate:

  sudo dpkg-reconfigure Kate

and it might work fine this way.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.