0

I have installed Ubuntu 14.04 some days ago. Now I am trying to update software using Software Updater, but it stops at:

Reading Database

I ran some commands on reading some websites, this is what I get as errors, please help:

$ sudo apt-get update && sudo apt-get upgrade
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?

$ ps -ef | grep apt
root      2206     1  0 17:56 ?        00:00:05 /usr/bin/python3 /usr/sbin/aptd
root      2347  2206  2 17:56 pts/12   00:00:16 /usr/bin/python3 /usr/sbin/aptd
root      2583  2347  0 17:57 pts/22   00:00:00 /usr/bin/dpkg --status-fd 52 --unpack --auto-deconfigure /var/cache/apt/archives/dpkg_1.17.5ubuntu5.1_i386.deb
sp        2948  2899  0 18:06 pts/24   00:00:00 grep --color=auto apt
Aditya
  • 13,416
IndianArt
  • 369
  • I have had a couple times already where the lock is on there and I don't know why. A restart fixed it. Silly suggestion but... – RhZ Apr 30 '14 at 13:00
  • Tried Restart many times & also tried several commands I got off the net to forcefully remove the lock. No luck so far. – IndianArt Apr 30 '14 at 13:03
  • @Aditya Tried various commands on the webpage whose link you have included above. Still get this message: 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? – IndianArt Apr 30 '14 at 13:16
  • Can someone please give me the specific command after identifying the offending apt?: sp@sp:~$ ps -ef | grep apt root 2206 1 0 17:56 ? 00:00:05 /usr/bin/python3 /usr/sbin/aptd root 2347 2206 2 17:56 pts/12 00:00:16 /usr/bin/python3 /usr/sbin/aptd root 2583 2347 0 17:57 pts/22 00:00:00 /usr/bin/dpkg --status-fd 52 --unpack --auto-deconfigure /var/cache/apt/archives/dpkg_1.17.5ubuntu5.1_i386.deb sp 2948 2899 0 18:06 pts/24 00:00:00 grep --color=auto apt – IndianArt Apr 30 '14 at 13:17
  • @IndianArt Reboot your system and then run that ps command to see the apt process which you need to kill. – Aditya Apr 30 '14 at 13:20
  • @Aditya As soon as I rebooted I typed this command in the terminal, without starting any other program. Its output was:

    sp@sp:~$ ps -ef | grep apt sp 2419 2370 0 18:58 pts/0 00:00:00 grep --color=auto apt Please could you give me the exact command because i am not an expert with the Terminal. Thanks.

    – IndianArt Apr 30 '14 at 13:32
  • @IndianArt Oli gave you a good answer.. Right now, none of the apt/dpkg process is running. You so, may remove the lock following this answer and re-run sudo apt-get update. – Aditya Apr 30 '14 at 13:44
  • So just remove the stray lock and all is well...hopefully – RhZ May 01 '14 at 04:17
  • @RhZ I am unable to remove this stray lock with all the different commands I got on the net. The Software Updater repeatedly stops at "Running post-installation trigger dpkg-exec" & the last line of the report is "(Reading Database..." – IndianArt May 01 '14 at 05:34
  • Wow I really don't know what to say, could you maybe reinstall? A pain in the butt I know, but it might be the path or least resistance... – RhZ May 01 '14 at 18:36
  • @Rhz This is possible because I have been trying 'stunts' by installing all kinds of stuff over several months. My impatience might have broken something in the last installation of a tool called ‘Folder Color’. its been 3 releases that I have been upgrading online (not fresh install), so its high time I do a fresh install. Thanks for all the help tho. :) – IndianArt May 03 '14 at 18:09
  • 1
    @IndianArt ok cool, yeah especially in my early days there were lots of reinstalls when things got screwed up. I recommend making a partition for file storage, I always divide my hard drive, so that if I have to reinstall I can save all files. Good luck! – RhZ May 04 '14 at 13:52

0 Answers0