Errors when trying to update and auto remove packages on Debian 8

Using a non-root account that can sudo, I get the following when running sudo apt-get autoremove:

E: Could not get lock /var/cache/apt/archives/lock - open (11: Resource temporarily unavailable)
E: Unable to lock directory /var/cache/apt/archives/

And the following when running sudo apt-get update && apt-get upgrade:

E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?

Do I need to be root to do this, or am I missing something?

1 Reply

Resource temporarily unavailable usually means something else has the lock, ie another apt-get or aptitude command is running somewhere. Note that on your second command, && is a shell command separator, so you need sudo for both sides of it; eg: sudo apt-get update && sudo apt-get upgrade. Otherwise only the first command gets sudo, and the second one doesn't.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct