[CentOS] Adding Repositories and using yum to download packages

Wed May 12 10:21:29 UTC 2010
Jatin Davey <jashokda at cisco.com>

On 5/12/2010 3:11 PM, John R. Dennison wrote:
> On Wed, May 12, 2010 at 02:55:49PM +0530, Jatin Davey wrote:
>    
>> [root at sc-devld-1 etc]# rpm -q centos-release
>> package centos-release is not installed
>>      
> 	Not CentOS :)
>
>    
>> Also i found that there is a file named as redhat-release.bak in the
>> /etc directory , doing a cat on it gives the following output:
>>
>> [root at sc-devld-1 etc]# cat redhat-release.bak
>> Red Hat Enterprise Linux Client release 5 (Tikanga)
>>      
> 	Something *very* fishy is going on.  In my opinion the
> 	state of that box can not be guaranteed and it should
> 	be reinstalled with either RHEL as it apparently originally
> 	was or as CentOS.
>
>
>
>
> 							John
>    

I found a workaround. tweaked some files and got it working. My 
intension on this box was to install the net-snmp agent and make it 
work. I tried using the source tarballs and rpms but never succeeded in 
installing it. Even yum did not work but then i did the following steps 
to get it working. I am not sure whether they are the right way to do it 
but i got it working for me.

1. Copied the CentOS-Base.repo file from other CentOS boxes on the box 
where i was facing troubles making yum work.

2. Opened the copied .repo file and edited it as shown below:

[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=5&arch=i386&repo=os
baseurl=http://mirrorlist.centos.org/?release=5&arch=i386&repo=os
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

#released updates
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
baseurl=http://mirror.centos.org/centos/5/updates/i386/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

Then when i issued the command: yum install net-snmp , the net-snmp 
package got installed and now i am monitoring it using snmp.

Thanks Everyone who gave support and clues in this regard.

Thanks
Jatin