RedHat4.8 yum 配置CentOS 4.8 源

1. 下载 yum安装包:

# wget http://vault.centos.org/4.8/os/i386/CentOS/RPMS/yum-2.4.3-4.el4.centos.noarch.rpm

# wget http://vault.centos.org/4.8/os/i386/CentOS/RPMS/yum-metadata-parser-1.0-8.el4.centos.i386.rpm

# wget http://vault.centos.org/4.8/os/i386/CentOS/RPMS/python-elementtree-1.2.6-5.el4.centos.i386.rpm

# wget http://vault.centos.org/4.8/os/i386/CentOS/RPMS/python-sqlite-1.1.7-1.2.1.i386.rpm

# wget http://vault.centos.org/4.8/os/i386/CentOS/RPMS/python-urlgrabber-2.9.8-2.noarch.rpm

# wget http://vault.centos.org/4.8/os/i386/CentOS/RPMS/sqlite-3.3.6-2.i386.rpm

# wget http://www.eomy.net/linux/install-yum/centos-yumconf-4-4.5.noarch.rpm  


2. 安装rpm包:

# rpm -ivh yum-2.4.3-4.el4.centos.noarch.rpm

warning: yum-2.4.3-4.el4.centos.noarch.rpm: V3 DSA signature: NOKEY, key ID 443e1821
error: Failed dependencies:
        yum-metadata-parser is needed by yum-2.4.3-4.el4.centos.noarch
        yumconf is needed by yum-2.4.3-4.el4.centos.noarch

# rpm -ivh yum-metadata-parser-1.0-8.el4.centos.i386.rpm
warning: yum-metadata-parser-1.0-8.el4.centos.i386.rpm: V3 DSA signature: NOKEY, key ID 443e1821
error: Failed dependencies:
        libsqlite3.so.0 is needed by yum-metadata-parser-1.0-8.el4.centos.i386

# rpm -ivh sqlite-3.3.6-2.i386.rpm
warning: sqlite-3.3.6-2.i386.rpm: V3 DSA signature: NOKEY, key ID 443e1821
Preparing...                ########################################### [100%]
   1:sqlite                 ########################################### [100%]

# rpm -ivh yum-metadata-parser-1.0-8.el4.centos.i386.rpm
warning: yum-metadata-parser-1.0-8.el4.centos.i386.rpm: V3 DSA signature: NOKEY, key ID 443e1821
Preparing...                ########################################### [100%]
   1:yum-metadata-parser    ########################################### [100%]

# rpm -ivh centos-yumconf-4-4.5.noarch.rpm 
warning: centos-yumconf-4-4.5.noarch.rpm: V3 DSA signature: NOKEY, key ID 443e1821
Preparing...                ########################################### [100%]
   1:centos-yumconf         ########################################### [100%]

# rpm -ivh yum-2.4.3-4.el4.centos.noarch.rpm
warning: yum-2.4.3-4.el4.centos.noarch.rpm: V3 DSA signature: NOKEY, key ID 443e1821
Preparing...                ########################################### [100%]
   1:yum                    ########################################### [100%]


以下rpm包也需要安装:

# rpm -ivh python-elementtree-1.2.6-5.el4.centos.i386.rpm

# rpm -ivh python-urlgrabber-2.9.8-2.noarch.rpm

# rpm -ivh python-sqlite-1.1.7-1.2.1.i386.rpm 


3. 修改 /etc/yum.conf:


01 [main ]
02 cachedir =/var/cache/yum
03 debuglevel =2
04 logfile =/var/log/yum.log
05 pkgpolicy =newest
06 installonlypkgs =kernel kernel-smp kernel-devel kernel-smp-devel kernel-largesmp kernel-largesmp-devel kernel-hugemem kernel-hugemem-devel
07 distroverpkg =centos-release
08 tolerant =1
09 exactarch =1
10 retries =20
11 obsoletes =1
12 gpgcheck =1
13 plugins =1
14
15 # PUT YOUR REPOS HERE OR IN separate files named file.repo
16 # in /etc/yum.repos.d
17
18 [base ]
19 name =centos-4.8 - Base
20 baseurl =http://vault.centos.org/4.8/os/i386/
21 # the other site: http://centos.candishosting.com.cn/centos/5/os/i386/
22 # you can find more site in: http://www.centos.org/modules/tinycontent/index.php?id=13
23 enabled =1
24 gpgcheck =1
25 gpgkey =http://vault.centos.org/4.8/os/i386/RPM-GPG-KEY-centos4
26 #released updates
27 [update ]
28 name =CentOS-4.8 - Updates
29 baseurl =http://vault.centos.org/4.8/updates/i386/
30 gpgcheck =1
31 gpgkey =http://vault.centos.org/4.8/os/i386/RPM-GPG-KEY-centos4
32 #packages used/produced in the build but not released
33 [addons ]
34 name =CentOS-4.8 - Addons
35 baseurl =http://vault.centos.org/4.8/addons/ $basearch/
36 gpgcheck =1
37 gpgkey =http://vault.centos.org/4.8/os/i386/RPM-GPG-KEY-centos4
38 #additional packages that may be useful
39 [extras ]
40 name =CentOS-4.8 - Extras
41 baseurl =http://vault.centos.org/4.8/extras/ $basearch/
42 gpgcheck =1
43 gpgkey =http://vault.centos.org/4.8/os/i386/RPM-GPG-KEY-centos4
44 #additional packages that extend functionality of existing packages
45 [centosplus ]
46 name =CentOS-4.8 - Plus
47 baseurl =http://vault.centos.org/4.8/centosplus/ $basearch/
48 gpgcheck =1
49 enabled =0
50 gpgkey =http://vault.centos.org/4.8/os/i386/RPM-GPG-KEY-centos4
51 #contrib - packages by Centos Users
52 [contrib ]
53 name =CentOS-4.8 - Contrib
54 baseurl =http://vault.centos.org/4.8/contrib/ $basearch/
55 gpgcheck =1
56 enabled =0
57 gpgkey =http://vault.centos.org/4.8/os/i386/RPM-GPG-KEY-centos4
58 #packages in testing
59 [testing ]
60 name =CentOS-5 - Testing
61 baseurl =http://vault.centos.org/4.8/testing/ $basearch/
62 gpgcheck =1
63 enabled =0
64 gpgkey =http://vault.centos.org/4.8/os/i386/RPM-GPG-KEY-centos4

4. # yum clean all

    # yum makecache

    # yum update


参考:

http://down.chinaz.com/server/201111/1321_1.htm

http://blog.csdn.net/sunboy_2050/article/details/5629370

http://hi.baidu.com/529970816/item/0ea855bb068c2af163388ef7

http://www.eomy.net/linux/install-yum/

https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/ch-yum.html

你可能感兴趣的:(RedHat)