1

Following on from my last question...I am getting an error when I try to use apt-get to install software which reads "Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?" I am definitely using aptget correctly - sudo apt-get install PACKAGENAME where PACKAGENAME is something I know is available on apt-get.

I have checked to see if apt is running using $ ps -e | grep apt (thanks to the helpful Ubuntu user who responded to my last question!) and I get the following:

13973 ?      00:00:07 aptd
14589 pts/1  00:00:07 aptd

I understand this (thanks again helpful person!) to mean that there are multiple aptd running at once. Looking at other questions about this as well as the response to my own question, much of the advice is "wait a few minutes until it stops; this is pretty normal." But I've now waited over an hour, and the only change is that the first of the two response lines initially read 00:00:03 aptd and now it reads 00:00:07 aptd.

My questions:

  1. Am I being over-anxious, and should I just wait longer before trying to meddle with anything further—basically am I wrong to think it's abnormal that it would take this long for aptd to finish?
  2. If I'm not wrong and something needs to be done, what is the best way to proceed? From what I've read, it seems like the next step should be to kill aptd, but I'm not clear at all on that.
  3. From all I've read, it seems like a bad idea to delete the lockfile on the administration directory at this stage—right?

1 Answers1

0

From question #2, you can use killall aptd to kill the processes, or a GUI task manager, then delete the lockfile, and restart your system. Should be fine as long as aptd and dpkg are not running.

Once you restart, you might not be able to use apt-get or dpkg again right away and it'll be locked again while it does its thing. Again, you will have to wait until they're done because the system updater will likely be looking for available updates. If you end up with a perma-lock again, then you have another issue with your system.

Delorean
  • 10,923
  • Thank you so much, Dorian. I'm going to try this and will report back. I have recent backups so even if I fry everything, it won't be the end of the world (a mantra I keep repeating to myself as I challenge myself with Ubuntu...!) – Flourish Mar 23 '17 at 19:15
  • OK, so, trying this I get: $ killall aptd aptd(13973): Operation not permitted aptd(14589): Operation not permitted aptd: no process found (only, you know, with linebreaks). Hm. My instinct is to sudo killall aptd but since I've got basically no idea what I'm doing I'm hesitant. I should also note that using ps -e | grep apt I now see that the processes are listed as 13973 ? 00:00:07 aptd and 14589 pts/1 00:00:10 aptd, which is another change from before. Not knowing what the 00:00:07 or 00:00:10 bits mean, I can't tell if this is good or not. – Flourish Mar 23 '17 at 19:20
  • OK. Got my courage up. Tried sudo killall aptd. It killed one of the two! So now I just have 14589 ? 00:00:10 aptd running when I check. This feels like a victory, but possibly a Pyrrhic victory. – Flourish Mar 23 '17 at 19:34
  • Run it again. Or, try to kill them with a GUI task manager. Once you have no more aptd or dpkg running, delete the lock file. You can also run a kill on a PID using sudo kill 14589 <- use the correct PID. – Delorean Mar 23 '17 at 19:36
  • sudo kill 14589 does not seem to work - it's still coming up when I check. Meanwhile, I can't find anything via a GUI task manager. I guess a combination of waiting, and checking, and trying again is indicated. Thank you for your patience with this—I can't imagine how irritating it must be to basically be someone's tech support from afar! – Flourish Mar 23 '17 at 19:40
  • It's not a problem, I try to help people, and other people help me, it's how it works. You may want to restart the system and try killing the processes again. Something might be locked up. – Delorean Mar 23 '17 at 19:41
  • Will do. Hope to see you on the other side of this reboot!

    I hope to someday be able to help someone as much as you're helping me, then. :)

    – Flourish Mar 23 '17 at 19:42
  • Just to close this out: I rebooted, and the whole thing magically resolved itself when I came back! Hooray! – Flourish Mar 23 '17 at 19:56
  • Great to hear! At least you know now for future reference the steps to take. Good luck linuxing! – Delorean Mar 23 '17 at 20:46