码迷,mamicode.com
首页 > 其他好文 > 详细

在RHEL6中配置YUM源

时间:2015-08-17 10:12:46      阅读:171      评论:0      收藏:0      [点我收藏+]

标签:yum   repo   repoforge   epel   rpmforge   

1 创建rhel-debuginfo.repo,如果有则先备份再删除

 cd  /etc/yum.repos.d
 rm  rhel-debuginfo.repo
 vi  rhel-debuginfo.repo 

插入以下内容:

 [Server] 
 name=Red Hat Enterprise Linux Server 
 baseurl=file:///home/redhat-iso  #本地iso的挂载路径
 enabled=1       #可以使用yum
 gpgcheck=0      #设置不检查gpgkey 
 gpgkey=file:///home/redhat-iso/RPM-GPG-KEY-RedHat-release    

2 修改yumRepo.py配置文件

cd /usr/lib/python2.6/site-packages/yum/
vi yumRepo.py

找到 remote = url + ‘/’ + relative #802行
改为 remote = "/home/redhat-iso" + ‘/‘ + relative

3 挂载iso文件

  mkdir /home/redhat-iso
  mount /dev/cdrom /mnt/cdrom

或者:

mount -o loop /home/Soft/rhel-server-6.3-x86_64-dvd.iso /mnt/cdrom

4 拷贝数据

cp /mnt/redhat-iso/* /home/redhat-iso

5 清除yum缓存:

yum clean all

6 测试安装ftp 默认没有安装

 yum list | grep vsftpd

[附-1]ubuntu设置本地软件安装源【DVD版】

(1) 转到镜像的下载目录,挂载ISO镜像挂载至 /media/cdrom 下:


> sudo mount -o loop -t iso9660 update-i386-20080312-CD1.iso /media/cdrom

(2) 手动添加ISO镜像至软件源列表,这样就可以在软件库里找到ISO上所有的软件包:

> sudo apt-cdrom -m -d=/media/cdrom add

(3) 刷新软件库:

> sudo apt-get update

注意,执行完成后查看 /etc/apt/sources.list 文件,确保文件如下一行在文件顶部或者在网络源前面,
否者,安装软件的时候系统还是优先从网络上下载;

【建议把除了dvd本地源之外的下面所有项注释掉,不建议删除,之后在apt-get update更新下】

deb cdrom:[Ubuntu 9.04 _Jaunty Jackalope_ - Release i386 (20090421.3)]/ 
jaunty main restricted

之后就可以用 apt-get install ** 来安装软件包了,
不过有点问题,这命令执行一次可能会不成功,多执行几次就OK了.

[附-2]Centos使用第三方软件源RepoForge

RepoForge源可以做为Centos官方源及EPEL源的补充,这样Centos下常用软件基本都可使用yum安装了。
Centos5:

rpm -ivh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el5.rf.i386.rpm
rpm -ivh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el5.rf.x86_64.rpm

Centos6:

rpm -ivh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.i686.rpm
rpm -ivh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm

国内使用sohu提供的镜像:

cat > /etc/yum.repos.d/mirrors-rpmforge <<EOF
http://mirrors.sohu.com/dag/redhat/el6/en/$ARCH/rpmforge
EOF
cat > /etc/yum.repos.d/mirrors-rpmforge-extras <<EOF
http://mirrors.sohu.com/dag/redhat/el6/en/$ARCH/extras
EOF
cat > /etc/yum.repos.d/mirrors-rpmforge-testing <<EOF
http://mirrors.sohu.com/dag/redhat/el6/en/$ARCH/testing
EOF

Repoforge ,以 RPMforge为人所熟知。它是专门为 Red Hat Enterprise Linux (RHEL), CentOS和科学Linux系统提供库包。如果你是这个类型的OS用户,可以添加其提高的源。安装如下:
对于64-bit CentOS 6.*系统:

$ sudo rpm -Uvhhttp://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm

对于For 32-bit CentOS 5.*系统:

$ sudo rpm -Uvhhttp://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el5.rf.i386.rpm

对于64-bit CentOS 5.*系统:

$ sudo rpm -Uvhhttp://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el5.rf.x86_64.rpm

一旦RPMforge源安装成功,你可以使用过yum命令去安装其有的库包。

[附-3] Ali-OSM : Alibaba Open Source Mirror Site

cd  /etc/yum.repos.d/
mv CentOS-Base.repo CentOS-Base.repo.back
wget -O CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

[附-4] [Webstatic Yum Repository]

Installation

To set up the repository, install the webtatic-release RPM:

Webtatic EL7 for CentOS/RHEL 7:

rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

Webtatic EL6 for CentOS/RHEL 6:

rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm

Webtatic EL5.1 for CentOS/RHEL 5:

rpm -Uvh http://mirror.webtatic.com/yum/el5/latest.rpm

Webtatic 5 for CentOS/RHEL 5:

rpm -Uvh http://mirror.webtatic.com/yum/centos/5/latest.rpm

Webtatic.com:

https://webtatic.com/projects/yum-repository/


查看原文

相关阅读


热门推荐


版权声明:本文为博主原创文章,未经博主允许不得转载|Copyright ©2011-2015, Kallen Ding, All Rights Reserved.

在RHEL6中配置YUM源

标签:yum   repo   repoforge   epel   rpmforge   

原文地址:http://blog.csdn.net/beautifulencounter/article/details/45537645

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!