一、本地yum源搭建

首先挂载上光盘
[root@www /]# mount /dev/cdrom /media/cdrom/
系统默认已经安装了可使用yum的软件包,所以可以直接配置:

[root@localhost ~]# cd /etc/yum.repos.d/                        yum源配置文件放置目录

[root@localhost yum.repos.d]# mv CentOS-Base.repo CentOS-Base.repo.bak    先将网络yum源        配置文件更名(让其失效)

[root@localhost yum.repos.d]# vim CentOS-Media.repo                编辑本地yum源文件

[c6-media]

name=CentOS-$releasever - Media        本地yum源名称(可随意修改)

baseurl=file:///media/cdrom               光盘挂载目录/mnt/sr0

gpgcheck=1

enabled=1                              使用此yum源(等于0为不启用)

gpgkey=file:///mnt/sr0/RPM-GPG-KEY-CentOS-6      本地yum源密钥

执行 yum list 检测是否可用

一、网络yum源搭建

网络yum源(前提是必须能连上互联网,此处使用的yum源是中国科技大学的地址如下:

中国科技大学:http://centos.ustc.edu.cn/centos/)

[root@localhost ~]# cd /etc/yum.repos.d/                        yum源配置文件放置目录
[root@localhost yum.repos.d]# vim CentOS-Base.repo            编辑网络yum源文件

[base]

name=CentOS-$releasever - Base

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os

baseurl=http://centos.ustc.edu.cn/centos/$releasever/os/$basearch/

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#released updates

[updates]

name=CentOS-$releasever - Updates

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates

baseurl=http://centos.ustc.edu.cn/centos/$releasever/updates/$basearch/

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#additional packages that may be useful

[extras]

name=CentOS-$releasever - Extras

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras

baseurl=http://centos.ustc.edu.cn/centos/$releasever/extras/$basearch/

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#additional packages that extend functionality of existing packages

[centosplus]

name=CentOS-$releasever - Plus

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus

baseurl=http://centos.ustc.edu.cn/centos/$releasever/centosplus/$basearch/

gpgcheck=1

enabled=0

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#contrib - packages by Centos Users

[contrib]

name=CentOS-$releasever - Contrib

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib

baseurl=http://centos.ustc.edu.cn/centos/$releasever/contrib/$basearch/

gpgcheck=1

enabled=0

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

三、注意事项:

使用yum时最好只能让一个yum源生效,因为系统默认优先使用网络yum源。

CentOS6.3配置yum源  http://www.linuxidc.com/Linux/2012-10/72750.htm

CentOS 6.4使用本地yum源 http://www.linuxidc.com/Linux/2013-12/93805.htm

RedHat Linux 本地yum源的配置 http://www.linuxidc.com/Linux/2013-08/88217.htm

RedHat 6.2 Linux修改yum源免费使用CentOS源 http://www.linuxidc.com/Linux/2013-07/87383.htm

配置EPEL YUM源 http://www.linuxidc.com/Linux/2012-10/71850.htm

Redhat 本地yum源配置 http://www.linuxidc.com/Linux/2012-11/75127.htm

yum的配置文件说明 http://www.linuxidc.com/Linux/2013-04/83298.htm

RedHat 6.1下安装yum(图文) http://www.linuxidc.com/Linux/2013-06/86535.htm

YUM 安装及清理 http://www.linuxidc.com/Linux/2013-07/87163.htm

CentOS 6.4上搭建yum本地源 http://www.linuxidc.com/Linux/2014-07/104533.htm

更多CentOS相关信息见CentOS 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=14

 

Linux 本地yum源搭建和网络yum源搭建的更多相关文章

  1. [Linux] 024 IP 地址配置和网络 yum 源

    1. IP 地址配置 (1) 使用 setup 工具 $ setup ps setup 是 RedHat 系列的功能:一般地,Debian系列没有这个功能 Xubuntu 没有这个功能 (2) 启动网 ...

  2. 【Linux】CentOS4 系统最后的网络yum源

    ------------------------------------------------------------------------------------------------- | ...

  3. linux:网络yum源和制作本地光盘yum源

    linux:存放yum源的位置:/etc/yum.repos.d/,该目录下全是一些yum源 一.网络yum源: 如图:下面全部都是yum源,后缀是".repo"都是合法的yum源 ...

  4. 搭建网络yum源

    #!/bin/bash #Linux搭建163网络yum源 cd /etc/yum.repos.d/ echo "-------------------下载163-repo--------- ...

  5. rhel配置网络yum源

    redhat 7.2配置网易yum源 卸载原来的yum源和安装必须的rpm包 1)确保虚拟机能够连接外网 2)前往http://mirrors.163.com/centos/7/os/x86_64/P ...

  6. centos网络yum源的安装

    CentOS使用EPEL YUM源EPEL (Extra Packages for Enterprise Linux)是基于Fedora的一个项目,为“红帽系”的操作系统提供额外的软件包,适用于RHE ...

  7. linux搭建本地和网络yum源

    [mirrors.163.com] name=mirrors.163.com baseurl=http://mirrors.163.com/centos/7/os/x86_64/ enabled=1 ...

  8. 如何搭建本地yum源,阿里yum源以及自己的网络yum源?

    环境:CentOS7 一.本地源的yum源的搭建 (一)添加新的yum源配置文件iso.repo(名字可以自己命名,但是后缀必须是repo结尾) 注意:目录 /etc/yum.repos.d 下的 . ...

  9. RHEL7.2系统下的软件管理(yum)、本地yum源和网络yum源的搭建

    在Liunx系统中,rpm和yum都可以安装软件,但rpm存在安装软件的依赖性,yum安装软件需要yum源 1.yum yum install softwarename ##安装 yum repoli ...

随机推荐

  1. Intervals poj 1201 差分约束系统

    Intervals Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 22503   Accepted: 8506 Descri ...

  2. Mosaic HDU 4819 二维线段树入门题

    Mosaic Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 102400/102400 K (Java/Others)Total S ...

  3. Android进阶笔记20:Android手机屏幕坐标系

    1. 手机屏幕坐标系: 整个坐标系是以手机屏幕左上角为原点(0,0),如下:

  4. 安装 ant

    (1)下载ant:http://ant.apache.org/bindownload.cgi (2)解压后放在指定的文件夹中(/usr/lib) (3) sudo chmod 777 /usr/lib ...

  5. DEDECMS 调用上级栏目标题

    在内容页,使用以下代码: {dede:field name='position' runphp='yes'} $tc="-"; //分隔符 $tw=$GLOBALS['cfg_li ...

  6. 写多个物件css3循环动画案例原理

    div { background-color: #67CF22; height: 100%; width: 6px; display: inline-block; -webkit-animation: ...

  7. JQuery multiselect的相关使用

    这两天做项目需要用到多选控件,于是选择了JQuery  multiselect控件,介绍一下常用的一些相关属性. 详细地址:http://davidstutz.github.io/bootstrap- ...

  8. 10 Interesting Linux Command Line Tricks and Tips Worth Knowing

    I passionately enjoy working with commands as they offer more control over a Linux system than GUIs( ...

  9. ASP.NET不拖控件教程(1)-认识JSON

    我讲讲脱离ASP.NET控件必备的一步,JSON和使用JQuery获取JSON吧! 高手跳过,写给学习中的人的.这篇帖子是假设你会使用JQuery(JQ这么普及,应该不至少没学过吧!真没学过以后再开帖 ...

  10. DWZ(JUI) 教程 普通表单提交

    一类是普通的表单提交,另一类就是列表页面的表单提交,主要是用来查询搜索列表使用的.今天我就简单介绍一下前者. 这是官网上的普通列表页面, <div class="pageContent ...