Author Topic: update repo in rhel 5.8 , centos 5.8  (Read 5755 times)

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2141
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
update repo in rhel 5.8 , centos 5.8
« on: มีนาคม 22, 2013, 08:39:54 AM »
ขั้นตอนการอัฟเดท repos ครับผม

#yum install yum-fastestmirror
#yum install yum-priorities
#uname -i

ถ้าเป็น i386 ใช้ตัวนี้
#cd /usr/local/src
#wget  http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm

ถ้าเป็น x86_64 ใช้
#cd /usr/local/src
#wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm

4) Install key

#rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt

5)Install rpmforge

#rpm -ivh rpmforge-release-0.3.6-1.el5.rf.i386.rpm

6) run
#yum check-update
« Last Edit: มีนาคม 22, 2013, 08:51:23 AM by golfreeze »

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2141
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
Re: update repo in rhel 5.8 , centos 5.8
« Reply #1 on: เมษายน 19, 2013, 09:03:41 AM »
เริ่มแรกถ้าใช้งาน RHEL ควรจะทำการอัฟเดท License ของ RH ก่อนนะครับ

#rhn_register --nox

The –nox parameter forces registration to stay at the command line and not go to the GUI.

ต่อจากนั้นทำการลง  yum-utils package จาก RHN.

#yum install yum-utils

ทำการ sync package จาก RHN

#reposync -p /updates --repoid=rhel-x86_64-server-5 -l

This will start the sync process. You can choose which repoid you want to sync by issuing the “yum repolist” command and selecting a specific one. This sync will take a bit of time depending on your WAN connection speed. After it finishes, we need to make the downloaded RPM packages into a Yum repository. We use the createrepo command to do this. Depending on your RHEL distribution, this could be a separate package or part of the yum-utils package. Issue this command to create the repository:

createrepo /updates

This will scan all of the RPMs in that directory and create a repository. Also, if you have 3rd party RPMs, you can add them to the /updates subdirectory and they’ll be added to the repository as well.

After all this, you now have a local repository! But, you’ll need to let other machines in your network know how to access it. Here’s a sample entry for your yum.conf file:

[rhel-baserepo]
name=Base Red Hat Enterprise Linux $releasever - $basearch
baseurl=file:///updates/rhel-x86_64-server-5
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

Now type “yum repolist” from the target machine and you should see the new local repository being loaded. You have now successfully setup your own RHN repository.