redhat6.0安裝yum

一,配置本地yumnode

1,掛載光盤python

mount /dev/cdrom /mnt/mediaweb

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

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

二,配置第三方yumcentos

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

2.下載yum 安裝文件
wget -c http://mirrors.163.com/centos/6/os/i386/Packages/yum-3.2.29-40.el6.centos.noarch.rpm緩存

wget -c http://mirrors.163.com/centos/6/os/i386/Packages/yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpmless

wget -c http://mirrors.163.com/centos/6/os/i386/Packages/yum-metadata-parser-1.1.2-16.el6.i686.rpm測試

wget -c http://mirrors.163.com/centos/6/os/i386/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpmthis

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,不改也能夠,可是查找的慢,有時候會報錯,最好對應了版本如此處是6。vim /etc/yum.repos.d/server.repo保存退出。

##############################################################################################################url

# 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 - Base - 163.com
baseurl=http://mirrors.163.com/centos/6/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=os
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

#released updates
[updates]
name=CentOS-6 - Updates - 163.com
baseurl=http://mirrors.163.com/centos/6/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6&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 - Extras - 163.com
baseurl=http://mirrors.163.com/centos/6/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6&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 - Plus - 163.com
baseurl=http://mirrors.163.com/centos/6/centosplus/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6&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 - Contrib - 163.com
baseurl=http://mirrors.163.com/centos/6/contrib/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=6&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

相關文章
相關標籤/搜索