After logging into Debian 12 Bookworm, if you try running different commands using sudo, you will see an error that is something like this.
For that, you will have to edit the sudoers file. To do that, first switch to the root account by typing in the Terminal:
After switching to root, edit the sudoers file that is found in /etc. You can open it with any text editor like vi or nano for this.
After opening this sudoers file, scroll down to the User privilege specification section, and add the username below the root privileges.
Save the changes and exit.
Switch back to the user from before and try running the previous commands again. They will now complete successfully without any errors.