redhat6.2配置yum

一,配置本地yum

1,掛載光盤

mount /dev/cdrom /mnt/media

2,新建本地yun源的配置文件
vi /etc/yum.repos.d/local.repo
加入以下信息:

[Local]
name=Local
baseurl=file:///mnt/media
enable=1
gpgcheck=0
 

二,配置第三方yum

1.刪除redhat 原有的yum
rpm -aq|grep yum|xargs rpm -e --nodeps

2.下載yum 安裝文件
wget -c http://mirrors.163.com/centos/6.4/os/x86_64/Packages/yum-3.2.29-40.el6.centos.noarch.rpm
wget -c http://mirrors.163.com/centos/6.4/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm
wget -c http://mirrors.163.com/centos/6.4/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
wget -c http://mirrors.163.com/centos/6.4/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm

3.安裝yum 軟件包
(1)rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm
(2)rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
(3) 兩個一起安裝先後順序不要亂(中間50%正常)
    rpm -ivh yum-3.2.29-40.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm

4.repo 文件
(1)清空yum倉庫
   rm -rf *
(2)http://mirrors.163.com/.help/CentOS6-Base-163.repo   進行修改
將所有$releasever 改爲你的版本號6.4,不改也可以,但是查找的慢,有時候會報錯,最好對應了版本如此處是6.4。vim /etc/yum.repos.d/server.repo保存退出。

##############################################################################################################

# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#

[base]
name=CentOS-6.4 - Base - 163.com
baseurl=http://mirrors.163.com/centos/6.4/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6.4&arch=$basearch&repo=os
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

#released updates
[updates]
name=CentOS-6.4 - Updates - 163.com
baseurl=http://mirrors.163.com/centos/6.4/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6.4&arch=$basearch&repo=updates
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

#additional packages that may be useful
[extras]
name=CentOS-6.4 - Extras - 163.com
baseurl=http://mirrors.163.com/centos/6.4/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6.4&arch=$basearch&repo=extras
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-6.4 - Plus - 163.com
baseurl=http://mirrors.163.com/centos/6.4/centosplus/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6.4&arch=$basearch&repo=centosplus
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

#contrib - packages by Centos Users
[contrib]
name=CentOS-6.4 - Contrib - 163.com
baseurl=http://mirrors.163.com/centos/6.4/contrib/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6.4&arch=$basearch&repo=contrib
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6


#################################################################################################################

5.測試
  先清緩存   yum clean all
  再更新緩存 yum makecache
  升級軟件包 yum update
  嘗試安裝軟件 yum -y install screen

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章