Shankar Ganesh

Just another WordPress site

“Unable to get exclusive lock” – Error when trying to update programs

with 28 comments


I just managed to install the latest version of Ubuntu on my PC, and it was like a smooth ride. My modem and other things worked smooth, and updating was a charm. Just a few commands and I’m done. I like the way this kinda command line updating in Linux. I really love it, and I’m exploring more commands and Googling a lot of stuff.


I wanted to install Epiphany (the name tempted me to try it), so used Synaptic and marked it for installation. But something was wrong.

I got the error message:

“Unable to get exclusive lock – This means that another package handler (like apt-get or aptitude) is already running. Please close that application first”

I went around, and found the solution. Just thought of writing them down here so that any of you facing this rather simple error can get it solved.

When you’re getting the ‘Unable to get exclusive lock’ message while trying to update, it actually means that there’s another instance of the package update manager running. Just cancel the other one, and then proceed this one.

If you can’t find any ‘visible signs’ of an update happening, it’s probably that some update process happening behind, something that’s unfinished.

Try the following commands:

$apt-get clean
$apt-get -f update

The above commands will clear the cache and terminate any unfinished business.

Now you can restart the update process (restart Synaptic or else try the command apt-get again for the update to begin).

If you still get the same error, use the command:
$ps -ax
This will display a list of running processes.

If you see some update process running in the background use the command
$sudo kill <process number>
to kill the process. This will do.

You feel a lot happy when you solve a problem yourself :) Let me know if I’ve written something incorrect here ;) because I’m doing this commands stuff practically for the first time.

Written by admin

December 27th, 2007 at 9:31 am

Posted in linux

  • Sriram Murali

    just my 2 cents to lessen the time ;)
    Instead of the ps -ax and then killing, you can try this kill -9 `pgrep update` or even simpler, pkill update-manager

  • Techblissonline Dot Com

    kill -9 `pgrep update` will kill all those running updates…may be you can do this update after all those terminates…unless you are sure that you don’t need the other updates…cheers,Rajesh

  • Sriram Murali

    Thanks Rajesh for that :)

  • Jalaj

    How do you rate it compared to Red Hat…?
    I have not used Linux for more than two years and last I used was Red Hat

  • Mahesh

    Can you let me know how you added the ‘about page’- (and so do the others like archives) along with the complete blog template.Does .htaccess has some role in this ?
    I downloaded the prosense theme but don’t know how to modify that.
    Can you write a tutorial for the newbies regarding the same?

  • Punjabi Movie lover

    i Have also encountered that problem many times
    i also followed the same route the kill the programme causing problem

    Linux tought me a lot of things
    anyways which Ubuntu you are using

  • Shankar Ganesh

    @TechBlissOnline, Sriram: Thanks a lot for the heads up. Much appreciated :)
    @Jalaj: Well, I find Ubuntu better because it’s easy to use compared with other distros. It’s kinda more user friendly, and has better detection of networks etc.
    Correct me if I’m wrong.
    @Mahesh: You can easily create a page on your blog by going to
    @Punjabi Movie Lover: Thanks for dropping by. I’m currently on Feisty Fawn.

  • Jalaj

    I will try using it… problem is Magazines these days are distributing Linux on DVDs for which I currently don’t have drive… looks as if I am lagging behind.

  • Recliners

    On an unrelated topic, can someone tell me what red hat is? i had only heard of white hat and black hat SEO.

  • Recliners

    And thanks for telling us how to solve that particular problem

  • Shankar Ganesh

    @Recliners: Red Hat is a distributor of a Linux Operating System called ‘Red Hat Enterprise Linux’. Red Hat provides similar free/open source software services. You can read more here: :)

  • Syahid A.

    And furthermore, if you can’t afford Red Hat EL, you can always use Centos Linux which imitates it nicely.

  • rambhai

    well how would you rate it against a red hat??? and is linux better than windows~~~(plzz dont say it better cause its free)

  • technofreak

    Hi dude,
    When you boot up your machine for the day, it starts checking for updates available and this uses the same dpkg as the synaptic does. So when you try to do something in synaptic, it tries to run the same dpkg which is already doing some work and has been locked by the update process. Please wait for some time and try again. Never kill the update process.

  • Music Site

    my friend got this problem before and there weren’t any visible signs of updating, well, he had to go to someone who fixed it for him and you know what? he had to pay money for that, lol, I woner if he will know it is that simple, lol.

    Thank you for sharing this,

  • Techblissonline Dot Com

    oh so this blog is still there…shankar why r u not using this at all?

  • Jalaj

    It sounds like it’s sleeting, but every time I turn on the outside light & look, nothings happening.

  • Andy

    PS How can I get that little cloud before the comment link on the blog? Is that Haloscan and Blog template?

  • marto

    Nice one mate, Thank`s for that information

  • gautham

    I tried apt-get clean it does not work.Then I tried pkill update -manager it works.
    Much appreciated work.Thank for the solution .

  • Nurhayani

    I have same proble.. and google bring me here. thanks Shankar.. You are the man… :D

  • amrinz

    Before, i must restart my PC.
    This blog is usefull

  • nathan

    Hey. i am sorry for this i am very out of date i guess. but if anyone at all can please email me step by step. i need help.
    i am the dumbest it gets to comptuers.
    i keep giving the compter the darn commands. and its like evil haha. it wont listen to me. it keeps giving me all this hibbidy jibbidy.

  • Liam

    I was having trouble downloading a wireless driver from behind a proxy. The attempts to get the driver were blocking me being able to update anything else. This helped, thanks a lot.

  • itisbasi

    Nice to find useful support for ubuntu outside ubuntuforums. Cheers and thanks for the help.

  • Sean

    Thanks, this fixed my problem (This is bookmarked now)

  • Blackjesus

    Man i have the same problem and i have tried:

    “$apt-get clean”

    “$apt-get -f update”
    “$ps -ax”

    but they just show this message :

    “bash: -get: command not found”

    so i tried :

    “pkill update -manager ”

    this killed all the updates that were happening
    but yet i still get this damn message :

    “Unable to get exclusive lock

    This usually means that another package management application (like apt-get or aptitude) is already running. Please close that application first.”

    all im trying to do is get java nd i have tried everyway but nothing works
    gahhh ubuntu is starting 2 piss me off
    can some one please help ?? :]

    or i might have 2 virtual box windows xp lol

  • Kaushik


    i got the solution by these command