Fresh Debian 12 installation. Added new user at install "administrator". Apparently sudo is not installed by default so I added sudo:
su -
apt install sudo -y
I then added the administrator to the sudo group:
su -
usermod -aG sudo administrator
When I am logged in as administrator, I can now do things successfully like:
sudo apt update -y
I can also do:
sudo su -
and I am given a root prompt and I have ID of 0, but for some reason if I try to do:
administrator@Hostname:~$ sudo apt update && apt upgrade -y && apt dist-upgrade -y
[sudo] password for administrator:
Hit:1 http://security.debian.org/debian-security bookworm-security InRelease
Hit:2 http://deb.debian.org/debian bookworm InRelease
Hit:3 http://deb.debian.org/debian bookworm-updates InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
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?
It appears there is something weird permission wise going on.
sudo apt update; sudo apt upgrade -y; sudo apt dist-upgrade -y
– Semyon Bayandin Oct 20 '23 at 10:36