Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I recently run into problems when using gksudo. For example, the Truecrypt installation fails because of following error:

** (gksudo:3262): WARNING **: Lock taken by pid: -1. Exiting.

PID must be a process id, but -1 can't be, correct?
How to remove this kind of lock?

share|improve this question
up vote 3 down vote accepted

You need to remove the lock for gksudo to work.

But instead of removing it, you can just rename it to something else.

Just try the following:

sudo mv  ~/.gksu.lock ~/.gksu.lock.old
share|improve this answer
What is the advantage of renaming a lock file rather than removing it? – Eliah Kagan Jun 21 '12 at 8:59
If you rename it you can restore it... No other reasons. Feel free to remove it! – jasmines Jun 21 '12 at 9:09
It's a lock file, and these are typically blank files. So can't it just be restored by making a new one? (Furthermore, anything that uses lock files will automatically recreate them as necessary. Lock files are not about storing data in the file. They are about storing data in the state associated with the file being accessed.) – Eliah Kagan Jun 21 '12 at 9:11
I agree I can be safely removed. This answer was helpful since I'm familiar with mv and just needed to know where the file is located. – phineas Jun 21 '12 at 14:36

Your Answer


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.