2

While logged in as the root account of a CLI installation, almost every application gives me this error:

Don't run this as root!

I want to bypass this error and run the application while logged into root. How do I do this?

Edit: I understand the risks of using the root user and I will still want to use it. Thank you for your suggestions.

Dev
  • 712

4 Answers4

3

You may add your very own User with sudo rights. You can create a User and add this User to the sudo Group.

sudo adduser youruser sudo

Or if you already have a user, you can add this to the sudo Group.

sudo usermod -a -G sudo youruser

After this log in to this user with su youruser and try to run the installation again with sudo yourinstallcommand.

You should never run any Installations with the root User. User always your very own User with sudo due to security reasons.

1

Fortunately this question has an answer that works. Using the root account is insecure and I understand that. The accepted answer there is going to help me a lot. Thank you for your suggestions, criticism, and help, bobbyblackblech, Pilot6, Serg, and Parto.

Dev
  • 712
1

Ubuntu comes with sudo by default. sudo is a package/command that allows you to run any command/application as root (sudo stands for SuperUser Do).

Your user is by default in sudoers file if you are administrator (who installs the system, per example).

Simply type:

sudo <command>

Example:

sudo gedit

This runs gedit as root. BE EXTREMELY CAREFUL WITH SUDO AND SUPERUSER/ROOT.

0

In addition to sudo, you might also need to disable X access control within your user X session:

xhost +
sudo foo
...
sudo bar

For foo and bar being X applications.

But I agree with everybody: don't do that!