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 have a problem with Ubuntu software center. It is "Searching" and "applying changes" for long period of time. I tired to cancel by clicking cross(X) mark. However, it is now stuck at "cancelling". It won't let me download any new application even from terminal i guess.

neal@neal-G50VT:~$ sudo apt-get install gnome-tweak-tool
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
neal@neal-G50VT:~$ sudo dpkg --configure -a
dpkg: error: dpkg status database is locked by another process

There are similar question here, but with no answers:

Software Center stuck for Dropbox

Software Center freezes during “applying changes

share|improve this question
    
I would try doing killall software-center. That should terminate software center. You may need to killall dpkg if there's still the "installation" stuffs in the background. –  Thomas W. Jun 5 '12 at 13:43
    
Tired this too. But no luck. –  nebula Jun 5 '12 at 14:24
    
try adding the -9 argument to them, so its killall -9 software-center and killall -9 dpkg –  Thomas W. Jun 5 '12 at 14:25

7 Answers 7

I had the same issue too. However, I tried the following. Ran

sudo lsof /var/lib/dpkg/lock

From there I identified the PID of the process causing my dpkg to lock. Then I did

sudo kill -TERM <PID>

Next, I did a

 sudo dpkg --configure -a

and waited for the result... after that i did a regular

sudo apt-get update && sudo apt-get upgrade

Hope it will work for you too.

share|improve this answer
    
Best answer thank YOU –  ucefkh Oct 1 '13 at 1:16
    
@ucefkh , Please thank me by up-voting the answer so that everyone else could find the best solution for such problem.. –  nipunshakya Oct 1 '13 at 10:32
    
i did , good job –  ucefkh Oct 1 '13 at 14:14
    
when I run the sudo lsof /var/lib/dpkg/lock it says lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs Output information may be incomplete. I am having the same problem in Ubuntu 14.4 –  Rana Muhammad Waqas May 16 at 13:38

Try to search for and terminate the /usr/bin/dpkg process:

Gabriel@UMWC:~$ ps ax | grep dpkg
 2058 pts/0    SNs+   0:00 /usr/bin/dpkg --status-fd 14 --configure -a --force-confdef --force-confold
 2061 pts/0    SN+    0:00 /bin/sh /var/lib/dpkg/info/nautilus-dropbox.postinst configure 
 2275 pts/2    S+     0:00 grep --color=auto dpkg
Gabriel@UMWC:~$ sudo kill 2058
share|improve this answer

For a similar problem, I removed and reinstalled the software-center and killed dpkg, then ran sudo apt-get update. After that I upgraded the packages.

share|improve this answer
2  
Do you mean something like sudo pkill dpkg ? –  belacqua Nov 20 '12 at 0:23

Make sure there isn't a dialog window somewhere that needs your input to allow the installation to proceed.

In a similar situation, you see, kill -9 worked for me. But then when I started Ubuntu Software Center again it was still stuck in the same spot. Until I closed all the open windows and saw that it was waiting for me to enter an answer. Duh. Software then finished installing.

share|improve this answer

i found that searching for the dpkg and sudo kill the process made the software center unresponsive which worked out well because all i had to do is reinstall software center.

sudo apt-get remove software-center

sudo apt-get autoremove software-center

To re-install Software Center:

sudo apt-get update

sudo apt-get install software-center

seems to work for me (note that i had tryed reinstalling before killing the dpkg and it still was stuck on "applying changes" so make sure to not skip out on that. :) hope this helps someone

share|improve this answer
    
autoremove does not take an argument. That is, sudo apt-get autoremove software-center is equivalent to sudo apt-get autoremove, and neither has anything in particular to do with the software-center package, though if you want to remove packages installed automatically as dependencies only of software-center, then it's correct to run sudo apt-get autoremove after running sudo apt-get remove software-center. Otherwise reinstalling USC just takes a single command: sudo apt-get --reinstall install software-center. (You probably want to use the --purge flag too, though.) –  Eliah Kagan Aug 19 '13 at 4:32

The best solution to these , is this:

sudo apt-get remove software-center
sudo apt-get autoremove software-center

To re-install Software Center:

sudo apt-get update
sudo apt-get install software-center
share|improve this answer
    
This answer is practically identical to the answer from jon. Please read all the answer before writing yours. Additionally, thanks and personal comments are not expected in this site (to thanks, upvote an answer or a comment). –  Rmano Nov 12 '13 at 3:22
    
Note that anything after autoremove does nothing - autoremove removes any and all automatically installed packages that are no longer required. In general, re-installation is rarely necessary. You should certainly try reconfiguring the package (sudo dpkg-reconfigure software-center) before doing anything drastic. –  chronitis Nov 12 '13 at 12:53

You could try a reboot.

It would solve your problem.

share|improve this answer
    
Software Center will just pick up where it left off, on most systems. –  Klikini Apr 27 '13 at 3:21

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.