synaptic+sudden reboot+exclusive lock problem

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

Try starting synaptic from

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.

Oh, I should mention that

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.

You may want to run "apt-get

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

I have recently installed

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

This message is telling you

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!

there is something else missing

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

You may want to run "apt-get

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!

in a terminal run this

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

php-5.2-monitor-zend-server installation problem


while installing php-5.2-monitor-zend-server

sudo apt-get install php-5.2-monitor-zend-server

i am getting this following error

Reading package lists... Done
Building dependency tree
Reading state information... Done
php-5.2-monitor-zend-server is already the newest version.
php-5.2-monitor-zend-server set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
1 not fully installed or removed.
Need to get 0B/2002kB of archives.
After this operation, 0B of additional disk space will be used.
(Reading database ... 179998 files and directories currently installed.)
Preparing to replace php-5.2-monitor-zend-server 4.0.72+b9 (using .../php-5.2-monitor-zend-server_4.0.72+b9_i386.deb) ...
Unpacking replacement php-5.2-monitor-zend-server ...
rm: cannot remove `/etc/usr/local/zend-server/zend/etc/rc.d/01monitor': No such file or directory
dpkg: warning - old post-removal script returned error exit status 1
dpkg - trying script from the new package instead ...
rm: cannot remove `/etc/usr/local/zend-server/zend/etc/rc.d/01monitor': No such file or directory
dpkg: error processing /var/cache/apt/archives/php-5.2-monitor-zend-server_4.0.72+b9_i386.deb (--unpack):
subprocess new post-removal script returned error exit status 1
rm: cannot remove `/etc/usr/local/zend-server/zend/etc/rc.d/01monitor': No such file or directory
dpkg: error while cleaning up:
subprocess post-removal script returned error exit status 1
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

can anyone help me how to solve this error.....