Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am running on Ubuntu 12.04 I recently noticed that Kate 4.8.4 which have been installed in my 64-bit PC is crashing whenever I try to open a file in it. It shows no problem when I open files via terminal.

It displays the following in the terminal while crashing.

trying to create local folder /home/myusername/.kde/tmp-MYPCNAME: Permission denied
trying to create local folder /home/myusername/.kde/socket-MYPCNAME: Permission denied
trying to create local folder /home/myusername/.kde/tmp-MYPCNAME: Permission denied
QFile::remove: Empty or null file name
kdeinit4: Aborting. bind() failed: Permission denied
Could not bind to socket '/home/myusername/.kde/socket-MYPCNAME/kdeinit4__0'
trying to create local folder /home/myusername/.kde/cache-MYPCNAME: Permission denied
trying to create local folder /home/myusername/.kde/share: Permission denied
kate(3237) fileModule: Failed to load configured file module "kfilemodule"
KCrash: Application 'kate' crashing...
KCrash: Attempting to start /usr/lib/kde4/libexec/drkonqi from kdeinit
sock_file=/home/myusername/.kde/socket-MYPCNAME/kdeinit4__0
Warning: connect() failed: : Permission denied
KCrash: Attempting to start /usr/lib/kde4/libexec/drkonqi directly
trying to create local folder /home/myusername/.kde/cache-MYPCNAME: Permission denied
QFile::remove: Empty or null file name
drkonqi(3251)/KSharedDataCache KSharedDataCache::Private::mapSharedMemory: Failed to establish shared memory mapping, will fallback to private memory -- memory usage will increase

From the above I understand that this is a problem of user privileges. I checked running Kate from the terminal as root it works fine.

As I am new to linux can someone point me in a direction that could solve the problem.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Change the ownership of the .kde folder with these console commands:

cd ~
sudo chown -R yourusername .kde

Replace yourusername with your actual user name. You will be prompted for the sudo password.

This error usually happens as a result of running graphical programs (like kate) as root directly with sudo, which can cause root to create its own configuration files in your home directory (or effectively take ownership of the ones that are already there). Instead, a graphical sudo frontend, such as kdesudo (or gksu/gksudo) should always be used when running graphical programs as root.

share|improve this answer
    
That solved the issue. But isn't user the owner of his or her home folder ? –  mahesmohan Jul 24 '12 at 21:57
    
@mahesmohan I've expanded this answer with an explanation for how root can come to own files in users' home folders (and how to avoid this problem in the future). –  Eliah Kagan Jul 25 '12 at 8:19
    
Thanks a lot @EliahKagan –  mahesmohan Aug 2 '12 at 15:44

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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