-2

I run the command apt update and upgade but it gave this error .I tried the other methods like dpkg other fixes, but it did not get fixed. Also used grep command also

the error ss

1 Answers1

4

Your command

sudo apt-get update && apt upgrade

contained two commands

  1. sudo apt-get update

ie. here you elevated the privileges for your first apt-get update command.

If the first commands was successful (&& operand) you told the machine to run a second command

  1. apt upgrade

this command you told the system to run with normal permissions; thus the permission denied error you received. The sudo for the first command you gave was only for that first command, not both commands you entered due to the manner in which you wrote it.

guiverc
  • 30,396