LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS
User Name
Password
CentOS This forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.

Notices


Reply
  Search this Thread
Old 09-06-2016, 08:48 AM   #1
puvi7722
LQ Newbie
 
Registered: Sep 2016
Posts: 7

Rep: Reputation: Disabled
Question Yum installation in Cent OS 5.6


Hi All,

Hope all doing great!!!!

i have installed speedtest cli in cent os 5.6. for that i have upgraded python 2.4 to 2.7. Speed test cli is working fine now.. But yum stopped working. i hope yum breaks all the repositories.

So none of the yum command is working,

PFB error

[root@XXYYY ~]# yum update
-bash: yum: command not found
[root@XXYYY ~]#

Please help me on this.
 
Old 09-06-2016, 08:52 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by puvi7722 View Post
Hi All, Hope all doing great!!!!

i have installed speedtest cli in cent os 5.6. for that i have upgraded python 2.4 to 2.7. Speed test cli is working fine now.. But yum stopped working. i hope yum breaks all the repositories.

So none of the yum command is working,

PFB error

[root@XXYYY ~]# yum update
-bash: yum: command not found
[root@XXYYY ~]#

Please help me on this.
Yum depends on python. You essentially broke python by manually upgrading it from 2.4 to 2.7. CentOS 5.6 is *VERY OLD*...so forcing this sort of thing isn't a good idea. Roll back whatever upgrade you did.

Before that, though...are you sure your PATH isn't corrupted??? Did you try just running /usr/bin/yum? Running "which yum", "locate yum", or even "find / -name yum", to see if it's still there??? What did you actually *DO* to 'upgrade' python?
 
Old 09-06-2016, 09:06 AM   #3
puvi7722
LQ Newbie
 
Registered: Sep 2016
Posts: 7

Original Poster
Rep: Reputation: Disabled
Question

Quote:
Originally Posted by TB0ne View Post
Yum depends on python. You essentially broke python by manually upgrading it from 2.4 to 2.7. CentOS 5.6 is *VERY OLD*...so forcing this sort of thing isn't a good idea. Roll back whatever upgrade you did.

Before that, though...are you sure your PATH isn't corrupted??? Did you try just running /usr/bin/yum? Running "which yum", "locate yum", or even "find / -name yum", to see if it's still there??? What did you actually *DO* to 'upgrade' python?
No path is already corrupted, as i am new to Linux i have done it without getting suggestions,so guide me on this..when i do "which yum"

I am getting below erroe

[root@XXYYY ~]# which yum
/usr/bin/which: no yum in (/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/root/bin)
[root@XXYYY ~]#
 
Old 09-06-2016, 10:44 AM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by puvi7722 View Post
No path is already corrupted, as i am new to Linux i have done it without getting suggestions,so guide me on this..when i do "which yum"

I am getting below erroe

[root@XXYYY ~]# which yum
/usr/bin/which: no yum in (/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/root/bin)
[root@XXYYY ~]#
Ok...and what about the OTHER commands you were given???? And if you're new to Linux, why are you using such an old system, and why are you manually upgrading things past what the package manager can do???

You were also asked about what you did to perform this upgrade, and haven't answered.
 
Old 09-06-2016, 11:03 AM   #5
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
The requirement yum has is "python >= 2.4", so upgrading to python-2.7 should not have broken that. Of course if you did that "upgrade" by first removing python-2.4, then yum would also have been removed due to the dependency. (But then, how would you have installed python-2.7?)

Is yum still installed? What is the output from
Code:
rpm -q yum
 
Old 09-08-2016, 08:15 AM   #6
puvi7722
LQ Newbie
 
Registered: Sep 2016
Posts: 7

Original Poster
Rep: Reputation: Disabled
Question

Quote:
Originally Posted by TB0ne View Post
Ok...and what about the OTHER commands you were given???? And if you're new to Linux, why are you using such an old system, and why are you manually upgrading things past what the package manager can do???

You were also asked about what you did to perform this upgrade, and haven't answered.
I just joined in one company they have this Cent OS 5.6 as a server along with asterisk configuration, so i can't disturb that, even netstat commands are not working. So when i was checking yum upgrading i found these error.

i have installed python 2.7 only to get the speedtest cli.I have upgraded manually python 2.7 by using downloading rpm file for python 2.7.

Now speedtest is working fine. But none of the yum & netstat commands are working, So request you guys to help me.
 
Old 09-08-2016, 08:19 AM   #7
puvi7722
LQ Newbie
 
Registered: Sep 2016
Posts: 7

Original Poster
Rep: Reputation: Disabled
Question

Quote:
Originally Posted by rknichols View Post
The requirement yum has is "python >= 2.4", so upgrading to python-2.7 should not have broken that. Of course if you did that "upgrade" by first removing python-2.4, then yum would also have been removed due to the dependency. (But then, how would you have installed python-2.7?)

Is yum still installed? What is the output from
Code:
rpm -q yum
I haved installed manually python 2.7 by downloading python 2.7 rpm file from internet.
I installed this in different directory opt.

i have no idea abt yum now. output for above command:

[root@XXYYY ~]# rpm -q yum
yum-3.2.22-33.el5.centos
[root@XXYYY ~]#
 
Old 09-08-2016, 09:38 AM   #8
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Quote:
Originally Posted by puvi7722 View Post
[root@XXYYY ~]# rpm -q yum
yum-3.2.22-33.el5.centos
[root@XXYYY ~]#
OK, it's still installed. /usr/bin/yum should be a Python script, with the first line specifying the interpreter:
Code:
#!/usr/bin/python
If that interpreter is missing, you get the same "No such file or directory" message as if /usr/bin/yum were missing.

Did you "install" python-2.7 by manually copying files into /opt, or did you try to use the rpm or yum commands to install it? What does "rpm -q python" report now?
 
Old 09-08-2016, 09:56 AM   #9
puvi7722
LQ Newbie
 
Registered: Sep 2016
Posts: 7

Original Poster
Rep: Reputation: Disabled
Question

Quote:
Originally Posted by rknichols View Post
OK, it's still installed. /usr/bin/yum should be a Python script, with the first line specifying the interpreter:
Code:
#!/usr/bin/python
If that interpreter is missing, you get the same "No such file or directory" message as if /usr/bin/yum were missing.

Did you "install" python-2.7 by manually copying files into /opt, or did you try to use the rpm or yum commands to install it? What does "rpm -q python" report now?
Thanks for reply.

Installed manually by copying. i haven't used any yum command to install Python.
 
Old 09-09-2016, 12:35 PM   #10
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Debian
Posts: 6,140

Rep: Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314
CentOS 5 is still alive, but only just! "End of life" will be 31 March 2017. It should not be used after support ends.

Manual installation of such a fundamental piece of software as Python is a very bad idea, as you have seen. For the question of safe sources, see
https://wiki.centos.org/AdditionalRe...s/Repositories

I'd start by going back to Python 2.4: download from either of these
https://pkgs.org/centos-5/centos-x86...86_64.rpm.html
https://pkgs.org/centos-5/centos-i38....i386.rpm.html
 
Old 09-09-2016, 12:53 PM   #11
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Quote:
Originally Posted by puvi7722 View Post
Installed manually by copying. i haven't used any yum command to install Python.
You should be able to run
Code:
rpm -V yum python
to verify that both packages are still intact. Changes to config files ("c" tag) are probably OK. Other changes, or complaints about missing files, are bad.
 
Old 09-10-2016, 12:43 AM   #12
puvi7722
LQ Newbie
 
Registered: Sep 2016
Posts: 7

Original Poster
Rep: Reputation: Disabled
Question

Quote:
Originally Posted by rknichols View Post
You should be able to run
Code:
rpm -V yum python
to verify that both packages are still intact. Changes to config files ("c" tag) are probably OK. Other changes, or complaints about missing files, are bad.
Result of this command 'rpm -V yum python' :

[root@XXYYY ~]# rpm -V yum python
missing /usr/bin/yum
S.5....T /usr/bin/pydoc
....L... /usr/bin/python
missing /usr/bin/python2
missing /usr/bin/python2.4
[root@XXYYY ~]#
 
Old 09-10-2016, 08:28 AM   #13
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Quote:
Originally Posted by puvi7722 View Post
Result of this command 'rpm -V yum python' :

[root@XXYYY ~]# rpm -V yum python
missing /usr/bin/yum
S.5....T /usr/bin/pydoc
....L... /usr/bin/python
missing /usr/bin/python2
missing /usr/bin/python2.4
[root@XXYYY ~]#
Looks like you did quite a bit more than just copy files to /opt. Your python-2.4 and yum installations are damaged and need to be reinstalled. You will need to download those RPMs and manually reinstall them with "rpm -i". You should be able to find the Centos 5.6 versions of those packages at vault.centos.org.
 
Old 09-10-2016, 08:46 AM   #14
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,621

Rep: Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695
Good lessons here for new people.
In general, do not install new versions of critical software outside of the versions available FOR your release outside of the normal automated tools/repositories.
If you must, compile or install a) from sources, b) in a different tree, and c) never overwrite or corrupt the existing software.

I compile and install latest releases that have known incompatibilities for more advanced options. I am VERY careful where I install and configure those, and what ports and resources they use. I am this careful because I have had DECADES of experiences breaking critical systems, and having to fix them. It can be fun, but more often is not.
 
Old 09-11-2016, 01:15 AM   #15
puvi7722
LQ Newbie
 
Registered: Sep 2016
Posts: 7

Original Poster
Rep: Reputation: Disabled
Smile

Quote:
Originally Posted by rknichols View Post
Looks like you did quite a bit more than just copy files to /opt. Your python-2.4 and yum installations are damaged and need to be reinstalled. You will need to download those RPMs and manually reinstall them with "rpm -i". You should be able to find the Centos 5.6 versions of those packages at vault.centos.org.
Thank you i will try the above steps.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Yum Dependency Tree Broken with RHEL 7 / Cent OS standards Linux - Software 10 05-08-2015 01:25 PM
To setup a yum repository on Cent OS tewtechie25 Linux - Newbie 7 04-12-2013 12:48 AM
YUM on Cent OS aggrishabh Linux - Newbie 6 04-27-2011 01:18 AM
please tellme how to install yum in cent os 5 meandsushil Linux - Server 14 02-18-2010 06:32 PM
Not Able To Login To Gnome session In Cent OS 5 after yum update rajesh.bahl Linux - General 5 12-02-2008 02:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS

All times are GMT -5. The time now is 06:55 PM.

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