-2

I was updating the PHP version to the newest in my CentOS server, following this guide step by step. When I finally get to install PHP, I get the following error.

sudo yum install php53 php53-cli php53-common php53-devel php53-gd
-bash: sudo: command not found

Or just

yum install php53 php53-cli php53-common php53-devel php53-gd
-bash: yum: command not found

Can anyone help me?

(sorry for my bad english)

Joele25
  • 1
  • 1

1 Answers1

2

The error tells you what is wrong: You don't have the sudo command available.

Either the package is installed, but the binary is not in your $PATH variable, or you need to install it.

If you execute commands as the root user you don't need to run the command with sudo. You can use sudo to run as another user, specified with the -u USERNAME flag.

jscott
  • 24,484
  • 8
  • 79
  • 100
Izzy
  • 795
  • 2
  • 8
  • 31
  • Thanks for the answer, now the problem is that yum is not found too.... – Joele25 Apr 22 '13 at 20:10
  • 2
    @Joele25 `su -` to root and run `yum install sudo` again. – jscott Apr 22 '13 at 20:17
  • Yum and sudo commands dont works – Joele25 Apr 22 '13 at 20:21
  • @Joele25 Are you root? `su -` is not the same as `sudo`. – jscott Apr 22 '13 at 20:28
  • What is the output of `echo $PATH` ? You probably don't have these commands in your path. –  Apr 22 '13 at 20:29
  • [root@euve21750 ~]# echo $PATH //sbin://bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin – Joele25 Apr 22 '13 at 20:31
  • @jscott I'm root – Joele25 Apr 22 '13 at 20:33
  • @Joele25 please run `whoami` to make sure you're root. You could also try the absolute path for yum. If I remember correctly that is `/usr/bin/yum` – Izzy Apr 22 '13 at 20:37
  • It said that i'm root.. and the directorty /usr/bin/yum doesnt exist – Joele25 Apr 22 '13 at 20:40
  • You can try `rpm -qa | grep -i yum` to see if yum is still installed or `whereis yum` and `which yum` to see if there is any path information on where the binary is installed. – Izzy Apr 22 '13 at 21:05
  • [root@euve21750 ~]# rpm -qa | grep -i yum yum-metadata-parser-1.1.2-4.el5 [root@euve21750 ~]# whereis yum yum: [root@euve21750 ~]# which yum /usr/bin/which: no yum in (//sbin://bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin) ... so yum is installed but i can run it – Joele25 Apr 22 '13 at 21:10
  • Are you sure it is installed? It seems to me there is only the yum-metadata-parser package. The empty result of `whereis` support that suspicion. Please try to reinstall the yum package manually(download the package and then afterwards install it via rpm) – Izzy Apr 22 '13 at 21:16
  • Please I'm a real dumbass of Centos can you please tell me how to do it? – Joele25 Apr 22 '13 at 21:19
  • Please use Google for those easy tasks the next time. There are extensive tutorials on how to do those basic tasks, like this [How to install yum on a Virtual Server](http://wiki.centos.org/TipsAndTricks/BrokenVserver) – Izzy Apr 22 '13 at 21:21
  • Ok, Thank you. But the question is how it is possible that i was running the yum command before and now i cant? – Joele25 Apr 22 '13 at 21:26