Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I get root access after I installed Ubuntu on my PC? The system keeps telling me that I have to be root for execution some of the commands.

share|improve this question

The standard approach is to prefix such commands with sudo. By default the userid you created during the installation will be able to use sudo. When you use sudo you will be prompted for the password of the userid you are running the command from (not the root password). You can enable additional users by adding them to the admin group or adding them to /etc/sudoers. On Ubuntu this can be done by adding the appropriate configuration lines to a file in the /etc/sudoers.d directory. These files need to be owned by root, and should no be accessible to others.

The command visudo can be used to safely edit sudoers files. By default it will use vi as the editor but it will use another editor if the EDITOR environment variable has been set to the desired command and exported.

share|improve this answer

Add sudo in front of the commands that are asking to be run a root.

sudo basically tells Ubuntu to run the command as the root user

You will be asked for your password

An alternative is running the sudo -i command and this will run all commands entered as root for as long as that terminal session remains open or exit is typed

EDIT: Be carefully with the sudo command as you can do seriously damage to Ubuntu, as I have found out many times myself.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.