fox111 发表于 2018-5-10 10:00:51

linux redhat yum工具安装配置

1、下载安装包
#wget http://tel.mirrors.163.com/CentOS/6/os/x86_64/Packages/yum-3.2.27-14.el6.centos.noarch.rpm
#wget http://tel.mirrors.163.com/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-14.1.el6.x86_64.rpm
#wget http://tel.mirrors.163.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.26-11.el6.noarch.rpm
#wget http://tel.mirrors.163.com/centos/6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
注:需要注意的是这个下载的路径在近期是可以的,时间长的话有可能会改变地址
2、卸载原有的rpm包
#rpm -qa|grep yum
#rpm -e --nodeps yum-*(查出来的包的名称)
3、安装新的包
#rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm
#rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
#rpm -ivh yum-3.2.29-40.el6.centos.noarch.rpmyum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
二、配置文件
1、下载CentOS6-Base-163.repo
#cd /etc/yum.repos.d
#mv CentOS6-Base-163.repo CentOS6-Base-163.repo.bak
#wget http://mirrors.163.com/.help/centos.html?1304848825/CentOS6-Base-163.repo
2、配置
#vi CentOS6-Base-163.repo

  name=CentOS-5-Base
  #mirrorlist=http://mirrorlist.centos.org/?release=$releasever5&arch=$basearch&repo=os
  #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
  baseurl=http://ftp.sjtu.edu.cn/centos/5/os/$basearch/
  gpgcheck=0
  gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
  #released updates

  name=CentOS-5-Updates
  #mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=updates
  baseurl=http://ftp.sjtu.edu.cn/centos/5/updates/$basearch/
  gpgcheck=0
  gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
  #packages used/produced in the build but not released

  name=CentOS-5-Addons
  #mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=addons
  baseurl=http://ftp.sjtu.edu.cn/centos/5/addons/$basearch/
  gpgcheck=0
  gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
  #additional packages that may be useful

  name=CentOS-5-Extras
  #mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=extras
  baseurl=http://ftp.sjtu.edu.cn/centos/5/extras/$basearch/
  gpgcheck=0
  gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
  #additional packages that extend functionality of existing packages

  name=CentOS-5-Plus
  #mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=centosplus
  baseurl=http://ftp.sjtu.edu.cn/centos/5/centosplus/$basearch/
  gpgcheck=0
  enabled=0
  gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
  #contrib - packages by Centos Users

  name=CentOS-5-Contrib
  #mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=contrib
  baseurl=http://ftp.sjtu.edu.cn/centos/5/contrib/$basearch/
  gpgcheck=0
  enabled=0
  gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
  # vi dag.repo

  name=Dag RPM Repository for RHEL5
  baseurl=http://ftp.riken.jp/Linux/dag/redhat/el5/en/$basearch/dag/
  enabled=1
  gpgcheck=0
  gpgkey=http://ftp.riken.jp/Linux/dag/packages/RPM-GPG-KEY.dag.txt
# yum clean all
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Cleaning repos: addons base dag extras update
Cleaning up Everything
#
# yum makecache
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
addons                                                                                                      | 1.9 kB   00:00   
addons/filelists_db                                                                                           |570 B   00:00   
addons/primary_db                                                                                             | 1.1 kB   00:00   
addons/other_db                                                                                             |554 B   00:00   
base                                                                                                          | 1.1 kB   00:00   
base/group                                                                                                    | 1.1 MB   00:07   
base/filelists                                                                                                | 3.7 MB   00:32   
base/primary                                                                                                | 1.3 MB   00:11   
base/other                                                                                                    |14 MB   01:51   
base                                                                                                                     3667/3667
base                                                                                                                     3667/3667
base                                                                                                                     3667/3667
dag                                                                                                         | 1.9 kB   00:00   
dag/filelists_db                                                                                              | 6.1 MB   09:28   
dag/primary_db                                                                                                | 7.0 MB   08:19   
dag/other_db                                                                                                | 1.5 MB   01:56   
extras                                                                                                      | 2.1 kB   00:00   
extras/group                                                                                                | 9.7 kB   00:00   
extras/filelists_db                                                                                           | 224 kB   00:06   
extras/primary_db                                                                                             | 173 kB   00:05   
extras/other_db                                                                                             | 442 kB   00:15   
update                                                                                                      | 1.9 kB   00:00   
update/filelists_db                                                                                           | 3.1 MB   01:07   
update/primary_db                                                                                             | 700 kB   00:13   
update/other_db                                                                                             |17 MB   05:01   
Metadata Cache Created
#
#  

导入key
# rpm --import http://ftp.sjtu.edu.cn/centos/5/os/i386/RPM-GPG-KEY-CentOS-5
运行YUM,测试
yum install httpd
页: [1]
查看完整版本: linux redhat yum工具安装配置