1

Just logged into a server my friend is using to host his website, so I can install some packages. I use Ubuntu myself, so I tried using apt-get out of habit, but the command was not found. Using cat /proc/version gave the following:

Linux version 2.6.32-773.26.1.lve1.4.35.el6.x86_64 (mockbuild@build.cloudlinux.com) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-18)

so I then tried using yum, but once again the command was not found. Trying rpm gives the same result. What can I do now?

3
  • 1
    Did you try asking the hosting service your friend is presumably paying for the hosting? Or checking on their site for FAQs? – Ignacio Vazquez-Abrams Nov 12 '17 at 20:33
  • @IgnacioVazquez-Abrams not yet, but that will be the next step. I thought maybe someone on here would know an easy / quick solution, because it normally takes a while for them to answer. – vwos Nov 12 '17 at 20:37
  • Possibly related? unix.stackexchange.com/q/352520/117549 – Jeff Schaller Nov 12 '17 at 22:28
4

The best thing to do would probably be to submit a support ticket with your hosting provided. They could have done all sorts of things that would cause your environment to differ from a standard Red Hat environment. That said, here's some stuff you could try.

It's possible that the yum directory just isn't your PATH. Since yum is intended to be used by the system administrator it might make sense for it to be in the path for the root user but not for a regular user. So the first thing to try would be running yum as root, e.g.:

sudo yum

If that doesn't work then try enumerating the directories in your PATH:

(IFS=:; for d in ${PATH}; do echo $d; done)

For a regular user I get something like this:

/usr/local/bin
/bin
/usr/bin
/usr/local/sbin
/usr/sbin
/home/username/.local/bin
/home/username/bin

And also for the root user's path:

sudo bash -c 'IFS=:; for d in ${PATH}; do echo $d; done'

And here is what I get for my root user:

/usr/local/sbin
/usr/local/bin
/usr/sbin
/usr/bin
/sbin
/bin

You can check your output against these to see if any directories are missing.

There are also a couple of commands you could use to search the file-system. If you have locate installed you could use that:

updatedb
locate yum

Otherwise, and if the file-system isn't too big, you could use find and not pull any punches (this is probably overkill):

sudo find / -name yum

The same thing goes for the rpm command.

Here are the paths for my yum and rpm commands:

user@host:~$ type -a yum
yum is /bin/yum
yum is /usr/bin/yum

user@host:~$ type -a rpm
rpm is /bin/rpm
rpm is /usr/bin/rpm

If none of that turns anything up then it would seem likely that your hosting provider just doesn't have it installed.

Here is a related link that you might want to skim through:

-bash: yum: command not found

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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