yum repo的配置,yum代理配置


以OpenStack Installation Guide for Red Had Enterprise Linux, CentOS, and Fedoraicehouse (September 19,2014)的源配置为例。


我的物理机是ubuntu12.04,可以上网。虚拟机是在其上起的CentOS6.5,不能上网。

首先,在物理机上下载 epel-release-6-8.noarch.rpm,和 rdo-release-icehouse-4.noarch.rpm

           在虚拟机上scp 这两个rpm到/opt/vsmrepo/目录下。

1> 在虚拟机上,安装这两个rpm包:

rpm -Uih epel-release-6-8.noarch.rpm

安装完以后,在 /etc/yum.repos.d/ 目录下:

epel.repo  epel-testing.repo  foreman.repo  puppetlabs.repo  rdo-release.repo CentOS6-Base-163.repo

将原来存在的CentOS-ALL.repo移除

2> 在虚拟机上 配置yum代理

  vim yum.conf 并加入代理(粗体部分)

  yum makecache,完了就O了

plugins=1
installonly_limit=5
bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&ref=http://bugs.centos.org/bug_report_page.php?category=yum
distroverpkg=centos-release

#  This is the default, if you make this bigger yum won't see if the metadata
# is newer on the remote and so you'll "gain" the bandwidth of not having to
# download the new metadata and "pay" for it by yum not having correct
# information.
#  It is esp. important, to have correct metadata, for distributions like
# Fedora which don't keep old packages around. If you don't like this checking
# interupting your command line usage, it's much better to have something
# manually check the metadata once an hour (yum-updatesd will do this).
# metadata_expire=90m

# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d
proxy=http://proxy.cd.intel.com:911

你可能感兴趣的:(linux,+,shell)