LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-15-2012, 09:28 AM   #1
sachinsud
Member
 
Registered: Aug 2011
Posts: 38

Rep: Reputation: Disabled
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??
 
Old 04-15-2012, 10:05 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,029

Rep: Reputation: 7343Reputation: 7343Reputation: 7343Reputation: 7343Reputation: 7343Reputation: 7343Reputation: 7343Reputation: 7343Reputation: 7343Reputation: 7343Reputation: 7343
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).
 
Old 04-15-2012, 10:11 AM   #3
sachinsud
Member
 
Registered: Aug 2011
Posts: 38

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
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
 
Old 04-15-2012, 11:30 AM   #4
sachinsud
Member
 
Registered: Aug 2011
Posts: 38

Original Poster
Rep: Reputation: Disabled
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?
 
Old 04-15-2012, 03:09 PM   #5
Satyaveer Arya
Senior Member
 
Registered: May 2010
Location: Palm Island
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,420

Rep: Reputation: 305Reputation: 305Reputation: 305Reputation: 305
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.

Last edited by Satyaveer Arya; 04-15-2012 at 03:14 PM.
 
Old 04-15-2012, 11:20 PM   #6
tollingalong
Member
 
Registered: Nov 2011
Posts: 42

Rep: Reputation: Disabled
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".
 
Old 04-16-2012, 05:04 AM   #7
sachinsud
Member
 
Registered: Aug 2011
Posts: 38

Original Poster
Rep: Reputation: Disabled
[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
 
Old 04-16-2012, 06:02 AM   #8
Satyaveer Arya
Senior Member
 
Registered: May 2010
Location: Palm Island
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,420

Rep: Reputation: 305Reputation: 305Reputation: 305Reputation: 305
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
 
Old 04-16-2012, 06:14 AM   #9
sachinsud
Member
 
Registered: Aug 2011
Posts: 38

Original Poster
Rep: Reputation: Disabled
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]#
 
Old 04-16-2012, 06:27 AM   #11
Satyaveer Arya
Senior Member
 
Registered: May 2010
Location: Palm Island
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,420

Rep: Reputation: 305Reputation: 305Reputation: 305Reputation: 305
Then you need to download the tar package of rpm and extract the package and compile and install that package.
 
Old 04-16-2012, 06:30 AM   #12
sachinsud
Member
 
Registered: Aug 2011
Posts: 38

Original Poster
Rep: Reputation: Disabled
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
 
Old 04-16-2012, 06:36 AM   #13
Satyaveer Arya
Senior Member
 
Registered: May 2010
Location: Palm Island
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,420

Rep: Reputation: 305Reputation: 305Reputation: 305Reputation: 305
What is the complete name of that package?
 
Old 04-16-2012, 06:37 AM   #14
sachinsud
Member
 
Registered: Aug 2011
Posts: 38

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Satyaveer Arya View Post
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
 
Old 04-16-2012, 06:40 AM   #15
Satyaveer Arya
Senior Member
 
Registered: May 2010
Location: Palm Island
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,420

Rep: Reputation: 305Reputation: 305Reputation: 305Reputation: 305
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?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] "bash: make: command not found" on CentOS 6 TehGoat Linux - Software 3 11-20-2011 03:06 PM
yum install flash ... yum: command not found ... which yum ... /usr/bin/yum tg0000 Fedora 8 04-13-2011 11:25 AM
When logging into Xserver I get a bash command not found error. AaronKillingsworth Slackware 3 12-29-2009 10:20 PM
Why -bash: rpm: command not found??? Also an rpm/yum Q? vbtalent Debian 6 01-23-2006 04:55 PM
bash: command not found error ksgill Linux - Newbie 10 07-01-2003 03:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration