红联Linux门户
Linux帮助

用CentOS的数据包来升级RedHat Linux

发布时间:2015-02-05 10:22:44来源:linux网站作者:mochinoname

CentOS和RedHat兼容,因此我们可以用CentOS的数据包来升级RedHat Linux。


修改yum配置:


1,修改 /etc/yum.repos.d/rhel-debuginfo.repo 为如下内容
[rhel-debuginfo]
name=Red Hat Enterprise Linux $releasever - $basearch - Debug
baseurl=ftp://ftp.redhat.com/pub/redhat/linux/enterprise/$releasever/en/os/$basearch/Debuginfo/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[base]
name=Red Hat Enterprise Linux $releasever -Base
baseurl=http://ftp.twaren.net/Linux/CentOS/5/os/$basearch/
gpgcheck=1
[update]
name=Red Hat Enterprise Linux $releasever -Updates
baseurl=http://ftp.twaren.net/Linux/CentOS/5/updates/$basearch/
gpgcheck=1
[extras]
name=Red Hat Enterprise Linux $releasever -Extras
baseurl=http://ftp.twaren.net/Linux/CentOS/5/extras/$basearch/
gpgcheck=1
[addons]
name=Red Hat Enterprise Linux $releasever -Addons
baseurl=http://ftp.twaren.net/Linux/CentOS/5/addons/$basearch/
gpgcheck=1


2.下载并导入yum key
cd /etc/pki/rpm-gpg

[root@localhost rpm-gpg]# wget http://mirrors.kernel.org/centos/RPM-GPG-KEY-CentOS-5

--2011-04-05 07:55:15--  http://mirrors.kernel.org/centos/RPM-GPG-KEY-CentOS-5

Resolving mirrors.kernel.org... 199.6.1.174, 130.239.17.6, 149.20.4.71, ...

Connecting to mirrors.kernel.org|199.6.1.174|:80... connected.

HTTP request sent, awaiting response... 200 OK

Length: 1504 (1.5K) [text/plain]

Saving to: `RPM-GPG-KEY-CentOS-5'

100%[============>] 1,504        833B/s   in 1.8s  

2011-04-05 07:55:20 (833 B/s) - `RPM-GPG-KEY-CentOS-5' saved [1504/1504]

rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY*