Error: This command has to be run under the root user

Trying Fedora for fun but when I say:

dnf install pkg1

It said

Error: This command has to be run under the root user.

Why is that? On Linode VPS I can ssh root@ip-add but on EC2 it is ssh ec2-user@IP-add and it won’t work at all. Please help!

Yes, you need to log in as root user. It can be done using any one of the following method:

sudo -i

Type your password when prompted. Another option is to login using the su command when you know root user password:

su -

For AWS/Google cloud sudo -i should work. For further info read:
https://www.cyberciti.biz/faq/how-can-i-log-in-as-root/

1 Like