6

I am trying to run this command:

sudo apt-get update && apt-get upgrade

but I keep getting these errors

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

I read in another answer that by using sudo these errors will be solved. But in my case I'm already using sudo. How to solve these errors?

Yogi Katba
  • 345
  • 3
  • 7
  • 16
  • 4
    You need to use `sudo` on the `apt-get upgrade` as well; the command after the '&&' is a separate command so isn't covered by the `sudo` on your first command. – guiverc Feb 06 '20 at 07:45

1 Answers1

8
sudo apt-get update && sudo apt-get upgrade

the commands before and after && are separate commands, so sudo must be used by both commands.

guiverc
  • 28,623
  • 5
  • 46
  • 74