LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Centos 5 Error :- -bash: yum: command not found (https://www.linuxquestions.org/questions/linux-server-73/centos-5-error-bash-yum-command-not-found-939900/)

sachinsud 04-15-2012 09:28 AM

Centos 5 Error :- -bash: yum: command not found
 
Hi,

I have taken a centos dedicated server of linux.
I tried to install one game panel to it. Somehow it did not go though well and i m in some real problem.

When i try to use the command Yum it says

-bash: yum: command not found
It was working fine earlier.

Somebody has told me i need to go for complete os reinstall. But for that i have to pay 100 dollars to data center as its chargable.

Is their any way to fix it??

pan64 04-15-2012 10:05 AM

it is hard to say from here. Maybe your path is not ok, maybe yum is lost somehow, maybe you can simply restore it (if you can boot and log in and in general the host is working properly).

sachinsud 04-15-2012 10:11 AM

Quote:

Originally Posted by pan64 (Post 4653277)
it is hard to say from here. Maybe your path is not ok, maybe yum is lost somehow, maybe you can simply restore it (if you can boot and log in and in general the host is working properly).


Yes i can login into putty as root
But when i try to do yum install anything or try to start any service as well
i get error message


[root@HYD1008 ~]# service iptables status
/sbin/service: line 3: /etc/init.d/functions: No such file or directory

sachinsud 04-15-2012 11:30 AM

I have another centos 5.7 server locally i moved init.d folder now everything is workign except for rpm and yum.
Kindly suggest what all files needs to be moved from other server to make it work?

Satyaveer Arya 04-15-2012 03:09 PM

Have you tried /usr/bin/yum instead of just yum?
It could be possible that /usr/bin has been removed from the path.
You can check by typing echo $PATH
Or it could also be that yum package accidentally removed.
Check if the yum packages is installed or not.

tollingalong 04-15-2012 11:20 PM

rpm -qa | grep -i yum

Let's see if the rpm is installed.
If there is some kind of response try a "which yum".

If it's not installed, you can download it from the centos site. Then you can you can install the RPM via "rpm -Uvh <name of the rpm".

sachinsud 04-16-2012 05:04 AM

[root@HYD1008 /]# cd usr
[root@HYD1008 usr]# cd bin
[root@HYD1008 bin]# cd yum
-bash: cd: yum: No such file or directory
[root@HYD1008 bin]# yum
-bash: yum: command not found
[root@HYD1008 bin]# echo $path

[root@HYD1008 bin]# which yum
/usr/bin/which: no yum in (/opt/mono-1.9/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)
[root@HYD1008 bin]#

Yes, i removed yum by mistake.

and rps is also not working.

Please suggest how can i install yum and rpm.

Thanks

Satyaveer Arya 04-16-2012 06:02 AM

You need following packages to install YUM software successfully -

yum
python-elementtree
python-iniparse
python-sqlite
rpm-python
python-urlgrabber
yum-metadata-parser
m2crypto

May be all the above packages already installed on your system.

Code:

# rpm -Uvh http://mirror.centos.org/centos/5/os/i386/CentOS/yum-3.2.8-9.el5.centos.1.noarch.rpm http://mirror.centos.org/centos/5/os/i386/CentOS/python-elementtree-1.2.6-5.i386.rpm http://mirror.centos.org/centos/5/os/i386/CentOS/python-iniparse-0.2.3-4.el5.noarch.rpm http://mirror.centos.org/centos/5/os/i386/CentOS/python-sqlite-1.1.7-1.2.1.i386.rpm http://mirror.centos.org/centos/5/os/i386/CentOS/rpm-python-4.4.2-48.el5.i386.rpm http://mirror.centos.org/centos/5/os/i386/CentOS/python-urlgrabber-3.1.0-2.noarch.rpm http://mirror.centos.org/centos/5/os/i386/CentOS/yum-metadata-parser-1.1.2-2.el5.i386.rpm http://mirror.centos.org/centos/5/os/i386/CentOS/m2crypto-0.16-6.el5.2.i386.rpm

sachinsud 04-16-2012 06:14 AM

I get this error message

[root@HYD1008 t]# rpm -Uvh http://mirror.centos.org/centos/5/os...s.1.noarch.rpm
-bash: rpm: command not found
[root@HYD1008 t]#

sachinsud 04-16-2012 06:24 AM

though i have downloaded all the rpm using wget and they r located in one directory with .rpm extension

wget http://vault.centos.org/5.7/os/x86_6...tos.noarch.rpm
wget http://vault.centos.org/5.7/os/x86_6...6-5.x86_64.rpm
wget http://vault.centos.org/5.7/os/x86_6...el5.noarch.rpm
wget http://vault.centos.org/5.7/os/x86_6...2.1.x86_64.rpm
wget http://vault.centos.org/5.7/os/x86_6...el5.x86_64.rpm
wget http://vault.centos.org/5.7/os/x86_6...el5.noarch.rpm
wget http://vault.centos.org/5.7/os/x86_6...tos.x86_64.rpm
wget http://vault.centos.org/5.7/os/x86_6...el5.x86_64.rpm


Now what should i do next?

Satyaveer Arya 04-16-2012 06:27 AM

Then you need to download the tar package of rpm and extract the package and compile and install that package.

sachinsud 04-16-2012 06:30 AM

I have webmin installed, using webmin i can extract the contents os the rpg package.

but i need help in compiling them.
Any walk though would be helpful.

Thanks

Satyaveer Arya 04-16-2012 06:36 AM

What is the complete name of that package?

sachinsud 04-16-2012 06:37 AM

Quote:

Originally Posted by Satyaveer Arya (Post 4653982)
What is the complete name of that package?


yum-3.2.22-37.el5.centos.noarch.rpm
python-elementtree-1.2.6-5.x86_64.rpm
python-iniparse-0.2.3-4.el5.noarch.rpm
python-sqlite-1.1.7-1.2.1.x86_64.rpm
rpm-python-4.4.2.3-22.el5.x86_64.rpm
python-urlgrabber-3.1.0-6.el5.noarch.rpm
yum-metadata-parser-1.1.2-3.el5.centos.x86_64.rpm
m2crypto-0.16-8.el5.x86_64.rpm

Satyaveer Arya 04-16-2012 06:40 AM

Quote:

yum-3.2.22-37.el5.centos.noarch.rpm
python-elementtree-1.2.6-5.x86_64.rpm
python-iniparse-0.2.3-4.el5.noarch.rpm
python-sqlite-1.1.7-1.2.1.x86_64.rpm
rpm-python-4.4.2.3-22.el5.x86_64.rpm
python-urlgrabber-3.1.0-6.el5.noarch.rpm
yum-metadata-parser-1.1.2-3.el5.centos.x86_64.rpm
m2crypto-0.16-8.el5.x86_64.rpm
Are you able to install all these packages using rpm -ivh <package-name> command? I think not because as you told that rpm package is also not installed on your machine, am I right?


All times are GMT -5. The time now is 02:59 PM.