淘先锋技术网

首页 1 2 3 4 5 6 7

centos是一个根据rhel rebuild的版本,它的目录结构,文件命名,所有软件包都跟rhel是完全兼容的,因此,我们完全可以用centosaptyum源来进行系统和软件更新.

 

apt下载页面:http://dag.wieers.com/packages/apt/

 

[root@netgate ~]#

 wget http://dag.wieers.com/packages/apt/apt-0.5.15lorg3.1-4.el4.rf.i386.rpm

...

[root@netgate ~]# rpm -ivh apt-0.5.15lorg3.1-4.el4.rf.i386.rpm

Preparing...                ########################################### [100%]

   1:apt                    ########################################### [100%]

[root@netgate ~]#

wget http://dag.wieers.com/packages/rpmforge-release/rpmforge-release-0.3.4-1.el4.rf.i386.rpm

 

[root@netgate ~]# rpm -Uvh rpmforge-release-0.3.4-1.el4.rf.i386.rpm

Preparing...                ########################################### [100%]

        package rpmforge-release-0.3.4-1.el4.rf is already installed

 

升级信息:

[root@netgate ~]# apt-get update

Get:1 http://apt.sw.be redhat/el4/en/i386/dag repomd.xml [1128B]

Fetched 1128B in 1s (833B/s)

Get:1 http://apt.sw.be redhat/el4/en/i386/dag/ primary.xml [1244kB]

Get:2 http://apt.sw.be redhat/el4/en/i386/dag/ filelists.xml [1592kB]

Fetched 2836kB in 2m13s (21.2kB/s)

Reading Package Lists... Done

Building Dependency Tree... Done

 

系统升级:

[root@netgate ~]# apt-get upgrade

Reading Package Lists... Done

Building Dependency Tree... Done

The following packages will be upgraded

  apt convmv freetype freetype-devel mtr nmap python-elementtree

  python-urlgrabber rsync syslinux xrestop yum

The following packages have been kept back

  lftp

12 upgraded, 0 newly installed, 0 removed and 1 not upgraded.

Need to get 4685kB of archives.

After unpacking 2767kB of additional disk space will be used.

Do you want to continue? [Y/n] Y

...

 

相关文件信息:

[root@backhost sources.list.d]# pwd

/etc/apt/sources.list.d

[root@backhost sources.list.d]# ll

total 16

-rw-r--r--  1 root root 951 Nov 30 10:28 os.list

-rw-r--r--  1 root root 207 Jan 18  2007 rpmforge.list

 

[root@backhost sources.list.d]# vi os.list

# Name: Operating system and updates

 

### Red Hat Enterprise Linux

#repomd http://mirror.centos.org centos/$(VERSION)/os/$(ARCH)

#repomd http://mirror.centos.org centos/$(VERSION)/updates/$(ARCH)

#repomd http://mirror.centos.org centos/$(VERSION)/extras/$(ARCH)

#repomd http://mirror.centos.org centos/$(VERSION)/fasttrack/$(ARCH)

#repomd http://mrepo rhel$(VERSION)s-$(ARCH)/RPMS.os

#repomd http://mrepo rhel$(VERSION)s-$(ARCH)/RPMS.updates

#rpm http://mrepo rhel$(VERSION)s-$(ARCH) os updates

 

### Fedora Core Linux

#repomd http://ayo.freshrpms.net fedora/linux/$(VERSION)/$(ARCH)/core

#repomd http://ayo.freshrpms.net fedora/linux/$(VERSION)/$(ARCH)/updates

#rpm http://ayo.freshrpms.net fedora/linux/$(VERSION)/$(ARCH) core updates

 

### Red Hat Linux

#repomd http://ayo.freshrpms.net redhat/$(VERSION)/$(ARCH)/os

#repomd http://ayo.freshrpms.net redhat/$(VERSION)/$(ARCH)/updates

#rpm http://ayo.freshrpms.net redhat/$(VERSION)/$(ARCH) os updates

 

[root@backhost sources.list.d]# vi rpmforge.list

# Name: RPMforge RPM Repository for Red Hat Enterprise 4 - dag

# URL: http://rpmforge.net/

#rpm http://apt.sw.be redhat/el$(VERSION)/en/$(ARCH) dag

repomd http://apt.sw.be redhat/el$(VERSION)/en/$(ARCH)/dag

 

下载yum软件包:

http://www.chinalinuxpub.com/yum.tgz

tar zxvf yum.tgz

cd yum

rpm -ivh *.rpm

 

用的是centosyum包,用这个yum就可以在线用centos升级rhel4

安装完成后执行:

rm -rf /etc/yum.repos.d/CentOS-Base.repo

vi /etc/yum.repos.d/as4-update.repo

加入

#released updates

[update]

name=Red Hat Enterprise AS release 4 Updates

baseurl=http://centos.ustc.edu.cn/centos/4/updates/i386/

gpgcheck=1

gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-centos4

 

vi /etc/yum.repos.d/as4-base.repo

加入

#released base

[base]

name=Red Hat Enterprise AS release 4 Updates

baseurl=http://centos.ustc.edu.cn/centos/4/os/i386/

gpgcheck=1

gpgkey=http://centos.ustc.edu.cn/centos/4/os/i386/RPM-GPG-KEY

 

保存然后就可以用yum升级AS4

yum upgrade

Transaction Summary

===================================================

Install     27 Package(s)

Update     372 Package(s)

Remove       0 Package(s)

Total download size: 474 M

Is this ok [y/N]: y

Downloading Packages:

(1/399): system-config-pr 100% |=================| 108 kB    00:03

(2/399): perl-Filter-1.34 100% |=================| 156 kB    00:15

 

升级完成重启后,操作系统的外观也会发生变化。