เทคนิคการอัพเดท CentOS แบบบังคับเวอร์ชั่นได้

โปรแกรมบน CentOS ที่ควรติดตั้งใช้งานร่วมกับ VoIP Server

เทคนิคการอัพเดท CentOS แบบบังคับเวอร์ชั่นได้

โพสต์โดย nuiz » 14 มิ.ย. 2011 17:57

*** บทความนี้ใช้ไม่ได้แล้วนะครับ เพราะว่าไฟล์เก่าๆถูกลบออกจากเซอร์เวอร์ที่ผมอ้างถึงในบทความแล้ว **

ปกติเราอัพเดท CentOS ด้วยคำสั่ง yum update ซึ่งมันจะอัพเดทให้เป็นเวอร์ชั่นล่าสุด แต่บางครั้งก็ไม่ใช่เวอร์ชั่นที่เราต้องการ

ผมต้องการอัพเกรดให้เป็นเวอร์ชั่น 5.5 (จากเวอร์ชั่น5.3) ปัจจุบันขณะนี้เป็นเวอร์ชั่น 5.6 ซึ่งถ้าผมอัพเดทด้วยคำสั่ง yum update โดยที่ไม่ได้แก้ไขอะไรเลย เครื่องก็จะกลายเป็นเวอร์ชั่น 5.6 ซึ่งผมไม่ต้องการ

ผมจะดึงไฟล์มาจากเซอร์เวอร์ mirror.issp.co.th แต่ไม่ทุกเซอร์เวอร์ที่ยังให้ดาวน์โหลดเวอร์ชั่นเก่ากว่าปัจจุบันได้

วิธีการอัพเดทให้เป็นเวอร์ชั่นที่ต้องการ ทำดังต่อไปนี้

1. ไฟล์ /etc/yum.repos.d/CentOS-Base.repo
ใส่เวอร์ชั่นที่ต้องการในบรรทัด baseurl ดังนี้

โค้ด: เลือกทั้งหมด
[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
baseurl=http://mirror.issp.co.th/centos/5.5/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/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/$releasever/updates/$basearch/
baseurl=http://mirror.issp.co.th/centos/5.5/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever - Addons
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons
#baseurl=http://mirror.centos.org/centos/$releasever/addons/$basearch/
baseurl=http://mirror.issp.co.th/centos/5.5/addons/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
baseurl=http://mirror.issp.co.th/centos/5.5/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
baseurl=http://mirror.issp.co.th/centos/5.5/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/
baseurl=http://mirror.issp.co.th/centos/5.5/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5


2. ลบไฟล์ใน cache

โค้ด: เลือกทั้งหมด
rm -rf /var/cache/yum/*


3. หยุด yum-updatesd

โค้ด: เลือกทั้งหมด
service yum-updatesd stop
chkconfig yum-updatesd off


4. เริ่มอัพเดท

โค้ด: เลือกทั้งหมด
yum -y update
** หากมีปัญหากับอุปกรณ์ที่ซื้อมาเองหรือบริการที่ทำขึ้นมาเอง ให้โพสต์ถามในเว็บบอร์ดนี้นะครับ **
** งานเร่งด่วนติดต่อว่าจ้างที่เบอร์ 08-5161-9439 อีเมล์ iamaladin@gmail.com ไลน์ NuizVoip ครับ **
nuiz
Diamond Member
 
โพสต์: 6993
ลงทะเบียนเมื่อ: 24 มี.ค. 2010 09:33

ย้อนกลับไปยัง CentOS - The Community Enterprise Operating System

ผู้ใช้งานขณะนี้

กำลังดูบอร์ดนี้: ไม่มีสมาชิกใหม่ และ บุคคลทั่วไป 2 ท่าน

cron