synaptic+sudden reboot+exclusive lock problem

Submitted by the0 on Tue, 2006-03-21 13:22.

Hi, Ubuntu is more or less functional on my laptop except batery management seems defective. When on battery, level drops gradually to 63% and then suddenly the laptop switches off. On restart batery is flat (0%) All of this is besides the point except that I unfortunately experienced this problem while using synaptic to install new software. Now I get the infamous "unable to get exclusive lock" message. I am certain that (after reboot(s)) no package manager is running anymore, and have removed the /var/lib/dpkg/lock file. All that happens when I start synaptic is this "unable to get exclusive lock" message, PLUS synaptic recreates the /var/lib/dpkg/lock file. How to get out of this mess? regards, Theo

( categories: Installation )
Submitted by Mustard on Wed, 2006-03-29 06:11.

Try starting synaptic from the command line and you might see more error messages that can give you a clue as to how to proceed.  I would suspect that it was in the middle of configuring something when it crashed and will not start again until such a time as that configuration is completed.  To start from the command line you can use gksudo synaptic.I'm hopeful its going to suggest running dpkg --configure -a, or apt-get install -f when the error messages appear in the terminal.  You could try to do these manually, assuming the lock file doesnt prevent you from doing so.

Submitted by Mustard on Wed, 2006-03-29 06:13.

Oh, I should mention that you might see some GTK errors when starting from command line.  These are pretty normal and not the actual error messages I would be looking for.

Submitted by wbmj on Tue, 2006-04-11 22:47.

You may want to run "apt-get clean". Also try "apt-get -f update". In theory this should empty the cache and resolve any unfinished business. Then try starting Synaptic

Submitted by Adriaan on Sat, 2006-12-09 12:11.

I have recently installed Dapper Drake, and is now experiencing the "Exclusive lock" problem on my desktop computer.
On performing dpkg --configure -a, I get the message: dpkg: status database area is locked by another process.
When performing apt-get install -f, the message is: could not open lock file /var/lib/dpkg/lock - open (13 Permission denied) Unable to lock the administration directory (var/lib/dpkg), are you root?
Performing apt-get clean gets me: Could not open lock file /var/cache/apt/archives/lock - open (13 Permission denied) Unable to lock the download directory
apt-get -f update gets me: Could not open lock file /var/lib/apt/lists/lock - open (13 Permission denied) Unable to lock the list directory.
I would appreciate it if anybody could help me to solve this problem
Regards, Adriaan

Submitted by ChrisFontenot13 on Sun, 2007-03-04 22:39.

This message is telling you that there is a lock file preventing your package manager from getting exclusive access.  Package managers create these lock files when they starts and if they crash, you reboot, your power goes out, etc, before they are completed, the lock file remains and the next manager believes another manager is already running.Use the following to delete the lock files, but make sure another copy of a package manager isn't running first.sudo rm /var/lib/dpkg/lock sudo rm /var/cache/apt/archives/lockGood luck!

Submitted by todor on Thu, 2007-06-21 21:00.

I have a similar problem. I was trying to install some packages and my Adept manager suddenly crashed. After that I can't start any Adept, aptitude or apt-get. I've tried all the hints here with no success. I'm running Kubuntu 7.0.4 64 bits on AMD X2.    After a while looking in other forums I've found the solution for my problem:    sudo dpkg --configure -a         Somehow the Adept Manager database has become corrupt and seems this is the solution ;-)    Cheers,    Todor

Submitted by rockinrobbie on Wed, 2007-11-21 14:51.

Excellent answer! I had the same problem and your solution worked perfectly. Kudos to you.I was a little worried about going with Ubuntu to begin with, because of the learning curve involved. Then I reasoned that while it may take a bit of time to get up to speed on this OS, I would probably save a ton of time not having to re-install <cough> Xp around once a month.  Thanks again!

Submitted by manuthomas on Thu, 2007-12-06 11:57.

in a terminal run this command:   dpkg --configure -a    that should solve ur issue. now u may run any package manager.