yum升级rhel5
生活随笔
收集整理的這篇文章主要介紹了
yum升级rhel5
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
刪除原來的/etc/yum.conf文件和/etc/yum.repo.d目錄
生成yum.conf,內容
[root@localhost etc]# cat yum.conf
[main]
cachedir=/var/cache/yum
keepcache=1
debuglevel=2
logfile=/var/log/yum.log
pkgpolicy=newest
distroverpkg=redhat-release
tolerant=1
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
metadata_expire=1800
# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d
[base]
name=centos-5 - Base
baseurl=http://centos.ustc.edu.cn/centos/5/os/i386/
# the other site: [url]http://centos.candishosting.com.cn/centos/5/os/i386/[/url]
# you can find more site in: [url]http://www.centos.org/modules/tinycontent/index.php?id=13[/url]
enabled=1
gpgcheck=1
gpgkey=http://centos.ustc.edu.cn/centos/5/os/i386/RPM-GPG-KEY-CentOS-5
#released updates
[update]
name=CentOS-5 - Updates
baseurl=http://mirror.centos.org/centos/5/updates/i386/
gpgcheck=1
gpgkey=http://centos.ustc.edu.cn/centos/5/os/i386/RPM-GPG-KEY-CentOS-5
#packages used/produced in the build but not released
[addons]
name=CentOS-5 - Addons
baseurl=http://mirror.centos.org/centos/5/addons/$basearch/
gpgcheck=1
gpgkey=http://centos.ustc.edu.cn/centos/5/os/i386/RPM-GPG-KEY-CentOS-5
#additional packages that may be useful
[extras]
name=CentOS-5 - Extras
baseurl=http://mirror.centos.org/centos/5/extras/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-5 - Plus
baseurl=http://mirror.centos.org/centos/5/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://centos.ustc.edu.cn/centos/5/os/i386/RPM-GPG-KEY-CentOS-5
#contrib - packages by Centos Users
[contrib]
name=CentOS-5 - Contrib
baseurl=http://mirror.centos.org/centos/5/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://centos.ustc.edu.cn/centos/5/os/i386/RPM-GPG-KEY-CentOS-5
#packages in testing
[testing]
name=CentOS-5 - Testing
baseurl=http://mirror.centos.org/centos/5/testing/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://centos.ustc.edu.cn/centos/5/os/i386/RPM-GPG-KEY-CentOS-5
2008.07.28更新 1. 安裝yum 2. 修改.repo文件 ccd /etc/yum.repos.d/ #vi CentOS-Base.repo 寫入以下內容: [base] 2kCLinux聯盟
name=CentOS-5 - Base 2kCLinux聯盟
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever5&arch=$basearch& 2kCLinux聯盟
repo=os 2kCLinux聯盟
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/ 2kCLinux聯盟
baseurl=http://ftp.sjtu.edu.cn/centos/5/os/$basearch/ 2kCLinux聯盟
gpgcheck=1 2kCLinux聯盟
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5 #released updates 2kCLinux聯盟
[update] 2kCLinux聯盟
name=CentOS-5 - Updates 2kCLinux聯盟
#mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=updates 2kCLinux聯盟
baseurl=http://ftp.sjtu.edu.cn/centos/5/updates/$basearch/ 2kCLinux聯盟
gpgcheck=1 2kCLinux聯盟
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5 #packages used/produced in the build but not released 2kCLinux聯盟
[addons] 2kCLinux聯盟
name=CentOS-5 - Addons 2kCLinux聯盟
#mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=addons baseurl=http://ftp.sjtu.edu.cn/centos/5/addons/$basearch/ 2kCLinux聯盟
gpgcheck=1 2kCLinux聯盟
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5 #additional packages that may be useful 2kCLinux聯盟
[extras] 2kCLinux聯盟
name=CentOS-5 - Extras 2kCLinux聯盟
#mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=extras baseurl=http://ftp.sjtu.edu.cn/centos/5/extras/$basearch/ 2kCLinux聯盟
gpgcheck=1 2kCLinux聯盟
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5 #additional packages that extend functionality of existing packages 2kCLinux聯盟
[centosplus] 2kCLinux聯盟
name=CentOS-5 - Plus 2kCLinux聯盟
#mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=centosplus 2kCLinux聯盟
baseurl=http://ftp.sjtu.edu.cn/centos/5/centosplus/$basearch/ 2kCLinux聯盟
gpgcheck=1 2kCLinux聯盟
enabled=0 2kCLinux聯盟
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5 #contrib - packages by Centos Users 2kCLinux聯盟
[contrib] 2kCLinux聯盟
name=CentOS-5 - Contrib 2kCLinux聯盟
#mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=contrib 2kCLinux聯盟
baseurl=http://ftp.sjtu.edu.cn/centos/5/contrib/$basearch/ 2kCLinux聯盟
gpgcheck=1 2kCLinux聯盟
enabled=0 2kCLinux聯盟
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5 # vi dag.repo2kCLinux聯盟
[dag]2kCLinux聯盟
name=Dag RPM Repository for RHEL52kCLinux聯盟
baseurl=http://ftp.riken.jp/Linux/dag/redhat/el5/en/$basearch/dag/2kCLinux聯盟
enabled=12kCLinux聯盟
gpgcheck=12kCLinux聯盟
gpgkey=http://ftp.riken.jp/Linux/dag/packages/RPM-GPG-KEY.dag.txt2kCLinux聯盟
? 2kCLinux聯盟
3. 導入key #rpm --import [url]http://ftp.sjtu.edu.cn/centos/5/os/i386/RPM-GPG-KEY-CentOS-5[/url] 4. 運行,測試 #yum update *********************************************************************************** 讓RHEL5也能YUM Centos5.1 2008-04-11 11:02
生成yum.conf,內容
[root@localhost etc]# cat yum.conf
[main]
cachedir=/var/cache/yum
keepcache=1
debuglevel=2
logfile=/var/log/yum.log
pkgpolicy=newest
distroverpkg=redhat-release
tolerant=1
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
metadata_expire=1800
# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d
[base]
name=centos-5 - Base
baseurl=http://centos.ustc.edu.cn/centos/5/os/i386/
# the other site: [url]http://centos.candishosting.com.cn/centos/5/os/i386/[/url]
# you can find more site in: [url]http://www.centos.org/modules/tinycontent/index.php?id=13[/url]
enabled=1
gpgcheck=1
gpgkey=http://centos.ustc.edu.cn/centos/5/os/i386/RPM-GPG-KEY-CentOS-5
#released updates
[update]
name=CentOS-5 - Updates
baseurl=http://mirror.centos.org/centos/5/updates/i386/
gpgcheck=1
gpgkey=http://centos.ustc.edu.cn/centos/5/os/i386/RPM-GPG-KEY-CentOS-5
#packages used/produced in the build but not released
[addons]
name=CentOS-5 - Addons
baseurl=http://mirror.centos.org/centos/5/addons/$basearch/
gpgcheck=1
gpgkey=http://centos.ustc.edu.cn/centos/5/os/i386/RPM-GPG-KEY-CentOS-5
#additional packages that may be useful
[extras]
name=CentOS-5 - Extras
baseurl=http://mirror.centos.org/centos/5/extras/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-5 - Plus
baseurl=http://mirror.centos.org/centos/5/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://centos.ustc.edu.cn/centos/5/os/i386/RPM-GPG-KEY-CentOS-5
#contrib - packages by Centos Users
[contrib]
name=CentOS-5 - Contrib
baseurl=http://mirror.centos.org/centos/5/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://centos.ustc.edu.cn/centos/5/os/i386/RPM-GPG-KEY-CentOS-5
#packages in testing
[testing]
name=CentOS-5 - Testing
baseurl=http://mirror.centos.org/centos/5/testing/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://centos.ustc.edu.cn/centos/5/os/i386/RPM-GPG-KEY-CentOS-5
2008.07.28更新 1. 安裝yum 2. 修改.repo文件 ccd /etc/yum.repos.d/ #vi CentOS-Base.repo 寫入以下內容: [base] 2kCLinux聯盟
name=CentOS-5 - Base 2kCLinux聯盟
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever5&arch=$basearch& 2kCLinux聯盟
repo=os 2kCLinux聯盟
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/ 2kCLinux聯盟
baseurl=http://ftp.sjtu.edu.cn/centos/5/os/$basearch/ 2kCLinux聯盟
gpgcheck=1 2kCLinux聯盟
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5 #released updates 2kCLinux聯盟
[update] 2kCLinux聯盟
name=CentOS-5 - Updates 2kCLinux聯盟
#mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=updates 2kCLinux聯盟
baseurl=http://ftp.sjtu.edu.cn/centos/5/updates/$basearch/ 2kCLinux聯盟
gpgcheck=1 2kCLinux聯盟
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5 #packages used/produced in the build but not released 2kCLinux聯盟
[addons] 2kCLinux聯盟
name=CentOS-5 - Addons 2kCLinux聯盟
#mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=addons baseurl=http://ftp.sjtu.edu.cn/centos/5/addons/$basearch/ 2kCLinux聯盟
gpgcheck=1 2kCLinux聯盟
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5 #additional packages that may be useful 2kCLinux聯盟
[extras] 2kCLinux聯盟
name=CentOS-5 - Extras 2kCLinux聯盟
#mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=extras baseurl=http://ftp.sjtu.edu.cn/centos/5/extras/$basearch/ 2kCLinux聯盟
gpgcheck=1 2kCLinux聯盟
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5 #additional packages that extend functionality of existing packages 2kCLinux聯盟
[centosplus] 2kCLinux聯盟
name=CentOS-5 - Plus 2kCLinux聯盟
#mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=centosplus 2kCLinux聯盟
baseurl=http://ftp.sjtu.edu.cn/centos/5/centosplus/$basearch/ 2kCLinux聯盟
gpgcheck=1 2kCLinux聯盟
enabled=0 2kCLinux聯盟
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5 #contrib - packages by Centos Users 2kCLinux聯盟
[contrib] 2kCLinux聯盟
name=CentOS-5 - Contrib 2kCLinux聯盟
#mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=contrib 2kCLinux聯盟
baseurl=http://ftp.sjtu.edu.cn/centos/5/contrib/$basearch/ 2kCLinux聯盟
gpgcheck=1 2kCLinux聯盟
enabled=0 2kCLinux聯盟
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5 # vi dag.repo2kCLinux聯盟
[dag]2kCLinux聯盟
name=Dag RPM Repository for RHEL52kCLinux聯盟
baseurl=http://ftp.riken.jp/Linux/dag/redhat/el5/en/$basearch/dag/2kCLinux聯盟
enabled=12kCLinux聯盟
gpgcheck=12kCLinux聯盟
gpgkey=http://ftp.riken.jp/Linux/dag/packages/RPM-GPG-KEY.dag.txt2kCLinux聯盟
? 2kCLinux聯盟
3. 導入key #rpm --import [url]http://ftp.sjtu.edu.cn/centos/5/os/i386/RPM-GPG-KEY-CentOS-5[/url] 4. 運行,測試 #yum update *********************************************************************************** 讓RHEL5也能YUM Centos5.1 2008-04-11 11:02
| 1.卸載rhel的yum相關的包 [root@virhost ~]# rpm -qa|grep yum yum-updatesd-3.0.1-5.el5 yum-3.0.1-5.el5 yum-rhn-plugin-0.5.2-3.el5 yum-metadata-parser-1.0-8.fc6 yum-security-1.0.4-3.el5 [root@virhost ~]# yum update Loading "rhnplugin" plugin Loading "installonlyn" plugin Loading "security" plugin This system is not registered with RHN. RHN support will be disabled. Setting up Update Process Setting up repositories No Repositories Available to Set Up Reading repository metadata in from local files Skipping security plugin, no data No Packages marked for Update/Obsoletion [root@virhost ~]# rpm -e yum-3.0.1-5.el5 --nodeps [root@virhost ~]# rpm -qa|grep yum yum-metadata-parser-1.0-8.fc6 yum-updatesd-3.0.1-5.el5 yum-rhn-plugin-0.5.2-3.el5 yum-security-1.0.4-3.el5 [root@virhost ~]# rpm -e yum-updatesd-3.0.1-5.el5 [root@virhost ~]# rpm -e yum-rhn-plugin-0.5.2-3.el5 [root@virhost ~]# rpm -e yum-metadata-parser-1.0-8.fc6(后來測試這個不應該卸載) [root@virhost ~]# rpm -e yum-security-1.0.4-3.el5 2.安裝centos的源 [url]http://centos.ustc.edu.cn/centos/5/os/i386/CentOS/yum-3.0.5-1.el5.centos.5.noarch.rpm[/url] rpm -ivh yum-3.0.5-1.el5.centos.5.noarch.rpm [root@virhost ~]# wget [url]http://centos.ustc.edu.cn/centos/5/os/i386/CentOS/yum-3.0.5[/url]- 1.el5.centos.5.noarch.rpm [root@virhost ~]# rpm -ivh yum-3.0.5-1.el5.centos.5.noarch.rpm warning: yum-3.0.5-1.el5.centos.5.noarch.rpm: Header V3 DSA signature: NOKEY, key ID e8562897 error: Failed dependencies: ??????? yum-metadata-parser is needed by yum-3.0.5-1.el5.centos.5.noarch [root@virhost ~]# wget [url]http://192.168.1.250/yum-metadata-parser-1.0-8.fc6.i386.rpm[/url] --07:48:55-- [url]http://192.168.1.250/yum-metadata-parser-1.0-8.fc6.i386.rpm[/url] Connecting to 192.168.1.250:80... 已連接。 已發出 HTTP 請求,正在等待回應... 200 OK 長度:22950 (22K) [text/plain] Saving to: `yum-metadata-parser-1.0-8.fc6.i386.rpm' 100%[==================================================================>] 22,950????? --.-K/s?? in 0.003s 07:48:55 (8.57 MB/s) - `yum-metadata-parser-1.0-8.fc6.i386.rpm' saved [22950/22950] [root@virhost ~]# rpm -ivh yum-metadata-parser-1.0-8.fc6.i386.rpm warning: yum-metadata-parser-1.0-8.fc6.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186 Preparing...??????????????? ########################################### [100%] ?? 1:yum-metadata-parser??? ########################################### [100%] [root@virhost ~]# rpm -ivh yum-3.0.5-1.el5.centos.5.noarch.rpm warning: yum-3.0.5-1.el5.centos.5.noarch.rpm: Header V3 DSA signature: NOKEY, key ID e8562897 Preparing...??????????????? ########################################### [100%] ?? 1:yum??????????????????? ########################################### [100%] 由此看來yum-metadata-parser-1.0-8.fc6.i386.rpm這個包不應該刪除那 [root@virhost ~]# cd /etc/yum.repos.d/ [root@virhost yum.repos.d]# ls rhel-debuginfo.repo [root@virhost yum.repos.d]# vi CentOS-Base.repo這個文件內如是下面的 [base] name=CentOS-5.1 - Base baseurl=http://mirror.tini4u.net/centos/5.1/os/$basearch/ [url]http://centos.ustc.edu.cn/centos/5.1/os/$basearch/[/url] gpgcheck=0 gpgkey=http://centos.ustc.edu.cn/centos/5.1/os/i386/RPM-GPG-KEY-CentOS-5 #released updates [updates] name=CentOS-5.1 - Updates baseurl=http://centos.ustc.edu.cn/centos/5.1/os/$basearch/ [url]http://centos.ustc.edu.cn/centos/5.1/os/$basearch/[/url] gpgcheck=0 gpgkey=http://centos.ustc.edu.cn/centos/5.1/os/i386/RPM-GPG-KEY-CentOS-5 #packages used/produced in the build but not released [addons] name=CentOS-5.1 - Addons baseurl=http://centos.ustc.edu.cn/centos/5.1/os/$basearch/ [url]http://centos.ustc.edu.cn/centos/5.1/os/$basearch/[/url] gpgcheck=0 gpgkey=http://centos.ustc.edu.cn/centos/5.1/os/i386/RPM-GPG-KEY-CentOS-5 #additional packages that may be useful [extras] name=CentOS-5.1 - Extras baseurl=http://centos.ustc.edu.cn/centos/5.1/os/$basearch/ [url]http://centos.ustc.edu.cn/centos/5.1/os/$basearch/[/url] gpgcheck=0 gpgkey=http://centos.ustc.edu.cn/centos/5.1/os/i386/RPM-GPG-KEY-CentOS-5 #additional packages that extend functionality of existing packages [centosplus] name=CentOS-5.1 ¨C Plus baseurl=http://centos.ustc.edu.cn/centos/5.1/os/$basearch/ [url]http://centos.ustc.edu.cn/centos/5.1/os/$basearch/[/url] gpgcheck=0 gpgkey=http://centos.ustc.edu.cn/centos/5.1/os/i386/RPM-GPG-KEY-CentOS-5 #contrib - packages by Centos Users [contrib] name=CentOS-5.1 - Contrib baseurl=http://centos.ustc.edu.cn/centos/5.1/os/$basearch/ [url]http://centos.ustc.edu.cn/centos/5.1/os/$basearch/[/url] gpgcheck=0 gpgkey=http://centos.ustc.edu.cn/centos/5.1/os/i386/RPM-GPG-KEY-CentOS-5 然后隨便測試了一個命令 [root@virhost yum.repos.d]# rpm -qa|grep postfix 剛好系統沒有裝這個包 [root@virhost yum.repos.d]# yum install postfix Loading "installonlyn" plugin Setting up Install Process Setting up repositories updates?????????????????? 100% |=========================| 1.1 kB??? 00:00???? contrib?????????????????? 100% |=========================| 1.1 kB??? 00:00???? centosplus??????????????? 100% |=========================| 1.1 kB??? 00:01???? addons??????????????????? 100% |=========================| 1.1 kB??? 00:00???? extras??????????????????? 100% |=========================| 1.1 kB??? 00:00???? Reading repository metadata in from local files primary.xml.gz??????????? 100% |=========================| 834 kB??? 00:03???? ################################################## 2400/2400 primary.xml.gz??????????? 100% |=========================| 834 kB??? 00:08???? ################################################## 2400/2400 primary.xml.gz??????????? 100% |=========================| 834 kB??? 00:08???? ################################################## 2400/2400 primary.xml.gz??????????? 100% |=========================| 834 kB??? 00:04???? ################################################## 2400/2400 primary.xml.gz??????????? 100% |=========================| 834 kB??? 00:08???? ################################################## 2400/2400 Parsing package install arguments Resolving Dependencies --> Populating transaction set with selected packages. Please wait. ---> Downloading header for postfix to pack into transaction set. postfix-2.3.3-2.i386.rpm 100% |=========================| 41 kB??? 00:00???? ---> Package postfix.i386 2:2.3.3-2 set to be updated --> Running transaction check Dependencies Resolved ============================================================================= Package???????????????? Arch?????? Version????????? Repository??????? Size ============================================================================= Installing: postfix???????????????? i386?????? 2:2.3.3-2??????? extras??????????? 3.6 M Transaction Summary ============================================================================= Install????? 1 Package(s)???????? Update?????? 0 Package(s)???????? Remove?????? 0 Package(s)???????? Total download size: 3.6 M Downloading Packages: (1/1): postfix-2.3.3-2.i3 100% |=========================| 3.6 MB??? 00:43???? Running Transaction Test warning: postfix-2.3.3-2: Header V3 DSA signature: NOKEY, key ID e8562897 Finished Transaction Test Transaction Test Succeeded Running Transaction Installing: postfix????????????????????? ######################### [1/1] Installed: postfix.i386 2:2.3.3-2 Complete! |
轉載于:https://blog.51cto.com/weijia/119673
總結
以上是生活随笔為你收集整理的yum升级rhel5的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Mocha BSM产品亮点——根本原因分
- 下一篇: 图解DOM中关于对象范围的属性