Skip to content
Advertisement

Unable to yum install in fedora even as root user

Getting the error Error: This command has to be run under the root user. when I try to install in Fedora as root user. Tried in different ways:

Sun May 20 20:18:57 kbsbng@tr
$ sudo yum install mod_ssl
Error: This command has to be run under the root user.
Sun May 20 20:19:00 kbsbng@tr
$ sudo bash
Sun May 20 20:19:03 root@tr
$ yum install mod_ssl
Error: This command has to be run under the root user.
Sun May 20 20:19:15 root@tr
$ su -
[root@tr ~]# yum install mod_ssl
Error: This command has to be run under the root user.

Is there any security setting that is causing this? I am trying all of the above commands by remotely sshing to the machine.

Advertisement

Answer

Your root user seems to be corrupted. If user group of root is assigned something out of root (or defined groups in visudo), it’ll not perform.

This will solve your problem since you’ll be setting user root to group root.

usermod -g root root
usermod -G root root

after entering this, logout and login.

Advertisement