0

I just ran sudo apt-get autoremove to keep my boot disk clear. I always run sudo apt-get update afterward to make sure my disk is properly updated, otherwise I have difficulty booting up, even through recovery mode.

Just ran sudo apt-get update, after the autoremove command, and it returned the following:

Reading package lists...done
E: Could not get lock /var/lib/apt/lists/lock - open (11:resource temporarily unavailable)
E:Unable to lock directory /var/lib/apt/lists/

That's it! What do I do to fix the command so I can run the update? I don't want to shut my computer off or even restart until I can fix this. I also hope this isn't a duplicate, but I couldn't find anything.

  • Weird. I just ran sudo apt-get autoremove again, to see if it would fix the problem. It did. I ran sudo-apt-get update afterward, and it worked perfectly fine.

    But it didn't ask for my password like it normally does. Should that worry me? Could this be a sign of something not functioning quite right?

    – A. Bergeron Jan 12 '18 at 19:59
  • Haha, that's nothing to worry, sudo caches your passwords for a small fixed amount of time, intended as a convenience so that you need not re-enter the password time and again. Look at the sudo manual – Mukesh Sai Kumar Jan 12 '18 at 20:04
  • Fabulous, I've been trying to find out where to go to learn more about how to control this OS. I love it, but it's my first time running linux. I'll be sure to look through that manual. Maybe I should do a few experiments too? Run a few of them? – A. Bergeron Jan 12 '18 at 20:44
  • Learning is experimenting. Go on! And GNU/Linux surely has an active community, here and elsewhere, and also lots of documentation, offline and online, to support you if you get stuck. – Mukesh Sai Kumar Jan 13 '18 at 05:43

1 Answers1

0

Run sudo apt-get autoremove one more time before trying to update. This fixed the problem for me. Very simple.

  • The likely reason that the problem was fixed is that something else (probably not autoremove) was doing Apt-related things and you waited long enough for it to finish, and it released the lock when it finished. – Chai T. Rex Jan 14 '18 at 06:52
  • Huh, how strange. It didn't tell me any of that. I wonder why? – A. Bergeron Jan 14 '18 at 08:20