I am using Ubuntu 12.04 and I don't get any updates.

For more than two weeks, whenever I try to check for updates manually it doesn't show any updates in the update manager. Then I tried via terminal using apt-get.

Then these following error messages are shown on the screen:

E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
E: Unable to lock directory /var/lib/apt/lists/
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?

and I couldn't see any error symbol in the system tray


You need to use sudo for all apt-get commands, but I'll assume that you're doing that...

You can find out what's locking those with lsof|grep /var/lib/dpkg and lsof|grep /var/lib/apt. That will show you anything that's accessing those files + directories. You can then kill those processes (and use lsof as needed to see if anything stays open). If killing them doesn't work, try a kill -KILL <pid> to send a SIGKILL, which should do the trick.

If you post what processes are locking those files, we can shut them off. For my personal system, I prefer to update my system with sudo apt-get update && sudo apt-get upgrade on my own on a daily basis.

edit, also try fuser - this may be an easier way for most, but keep lsof in your pocket as a must-know Linux command. Always use sudo for process-related commands, because you might miss out on something that you don't own.

me@me:/tmp$  sudo fuser /var/cache/debconf/config.dat
/var/cache/debconf/config.dat:  8112
me@me:/tmp$ ps aux|grep 8112
root      8112  0.0  0.0  71276 15984 pts/5    SN+  May13   0:00 /usr/bin/perl -w    /usr/sbin/dpkg-preconfigure --apt

Solution 1

The error is caused because Ubuntu does not allow the user to run many of the system commands as you do not have the correct privileges. To overcome these, type

sudo apt-get

The sudo command gives you full privileges for that command.

Solution 2

To receive updates, Click on the System Settings Icon and then on Software and Updates. When this window opens, click on the updates tab and select the appropriate areas you would like to update then select how often and when & what to do with any updates from the drop down lists.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.