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
Asked
Active
Viewed 542 times
1 Answers
4
Your command
sudo apt-get update && apt upgrade
contained two commands
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
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
apt upgrade
withoutsudo
.... You first command included thesudo
, but the second command you provided did not. – guiverc Jul 30 '23 at 10:59