Debian by default does not enable a non-root user to do anything requiring administrator permissions for things like installing software or updating and upgrading your system. By default, you have to be root in order to do such things, and you do so by typing:
And then typing in the root password.
This article will discuss how to add your username to the sudo group which will allow you to do commands with sudo, like in Ubuntu.
Ubuntu by default will enable your main username to use sudo commands, but I am not sure why Debian by default does not. Even Debian admits it is safer to use sudo for administrative tasks than to be logged in as the root user. I personally think being logged in as root every time to install software or do other things is way too dangerous. So, therefore, I use sudo. Adding your username to the group sudo should be one of the first things you do after installing Debian.
Steps For Adding Your Username To Sudo
Adding your username to the group sudo is very simple in Debian. First, login as the superuser (a.k.a. root) by typing:
Then type in the root password. Then, simply type:
adduser yourusername sudo
So, for example, if your username were tony, you would type:
adduser tony sudo
Log Out And Log Back In Or Restart Your Computer
You won’t be able to use the command sudo with your username until you log out and log back in or restart your computer.
After logging out and logging back in or restarting, you should be able to use the command sudo with your normal username. For example, if you were logged in as user tony, should should be able to do the command:
sudo apt-get update && sudo apt-get upgrade -y
What did you think of this article? Let’s discuss it in the comments below.