在CentOS 6上可以使用系统安装光盘为本机创建yum repository,创建过程如下。

  • 创建光盘mount点

[root@centos62 ~]# mkdir /media/CentOS

  • mount安装盘

[root@centos62 ~]# mount /dev/sr0 /media/CentOS
mount: block device /dev/sr0 is write-protected, mounting read-only [root@centos62 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_centos62-lv_root
18G 752M 16G 5% /
tmpfs 495M 0 495M 0% /dev/shm
/dev/sda1 485M 31M 429M 7% /boot
/dev/sr0 4.2G 4.2G 0 100% /media/CentOS
  • 修改yum repository配置

yum repository的配置文件存储在/etc/yum.repos.d目录下,修改repos配置如下所示(红色部分)

[root@centos62 ~]# cd /etc/yum.repos.d/

[root@centos62 yum.repos.d]# more CentOS-Media.repo
# CentOS-Media.repo
#
# This repo is used to mount the default locations for a CDROM / DVD on
# CentOS-6. You can use this repo and yum to install items directly off the
# DVD ISO that we release.
#
# To use this repo, put in your DVD and use it with the other repos too:
# yum --enablerepo=c6-media [command]
#
# or for ONLY the media repo, do this:
#
# yum --disablerepo=\* --enablerepo=c6-media [command] [c6-media]
name=CentOS-$releasever - Media
baseurl=file:///media/CentOS/
file:///media/cdrom/
file:///media/cdrecorder/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

  • disable base repository

将base repository配置文件重命名

[root@centos62 yum.repos.d]# mv CentOS-Base.repo CentOS-Base.repo.disabled
  • 清除缓存并显示repository

[root@centos62 yum.repos.d]# yum clean all
Loaded plugins: fastestmirror
Cleaning repos: c6-media
Cleaning up Everything
Cleaning up list of fastest mirrors [root@centos62 yum.repos.d]# yum repolist
Loaded plugins: fastestmirror
Determining fastest mirrors
* c6-media:
c6-media | 4.0 kB 00:00 ...
c6-media/primary_db | 4.5 MB 00:00 ...
repo id repo name status
c6-media CentOS-6 - Media 6,294
repolist: 6,294

如何使用安装光盘为本机创建yum repository的更多相关文章

  1. centos6.6安装mysql5.7.6(采用MySQL Yum Repository)—(先看最后一行)

    在centos6.6系统上采用MySQL Yum Repository安装mysql5.7.6: 帮助文档:http://dev.mysql.com/doc/refman/5.7/en/linux-i ...

  2. Adobe Photoshop CC 2018 v19.0 简体中文正式版下载安装破解(附注册机+破解教程) 32/64位(安装破解注意事项是什么)

    Adobe Photoshop CC 2018 v19.0 简体中文正式版下载安装破解(附注册机+破解教程) 32/64位(安装破解注意事项是什么) 一.总结 一句话总结:下载安装破解教程文中都有,需 ...

  3. CentOS使用安装光盘建立本地软件源

    本实验的目的是使用CentOS的两张DVD安装光盘作为本地软件源,避免执行yum安装命令时每次都要从网络重新下载. 安装createrepo软件包 createrepo是制作软件源所需要的一个工具,默 ...

  4. 图解RHEL6从安装光盘中进行yum安装

    图解RHEL6从安装光盘中进行yum安装 导读:我们这里讲的Yum,是Yellow dog Updater, Modified的缩写,可执行程序名为yum,它的理念是使用一个中心仓库(reposito ...

  5. docker安装elasticsearch6.8.3-单机模式及可视化Kibana6.8.3

    docker安装elasticsearch6.8.3-单机模式 拉取镜像 docker pull elasticsearch:6.8.3 创建容器  测试环境加上-e "discovery. ...

  6. ArcSDE for SQL Server安装及在ArcMap中创建ArcSDE连接

    原文:ArcSDE for SQL Server安装及在ArcMap中创建ArcSDE连接 安装ArcSDE for SQL Server,最后一步成功后的界面如下: 在ArcMap中创建ArcSDE ...

  7. 一行命令搞定VS2012无法安装cocos2d-x-2.1.4及创建跨平台项目(二)

    转自:http://blog.csdn.net/yangjingui/article/details/9418843 由于上次发了一个比较二的方法来解决VS2012无法安装cocos2d-x-2.1. ...

  8. Visual Studio 2015和.Net 2015 预览版在线安装和ISO镜像安装光盘下载

    微软刚刚宣布了 Visual Studio 2015和.Net 2015 预览版,并同时提供了下载. 微软在纽约正进行中的#Connect# 全球开发者在线大会上宣布了Visual Studio 20 ...

  9. 《Oracle Database 12c DBA指南》第二章 - 安装Oracle和创建数据库(2.1 安装Oracle数据库软件和创建数据库概览)

    当前关于12c的中文资料比较少,本人将关于DBA的一部分官方文档翻译为中文,很多地方为了帮助中国网友看懂文章,没有按照原文句式翻译,翻译不足之处难免,望多多指正. 2.1 安装Oracle数据库软件和 ...

随机推荐

  1. Maven——安装配置

    MAVEN 一.介绍:(待填) 二.下载:http://maven.apache.org/download.cgi(官网下载) 选择二进制的zip文件,这种的可直接使用. 三.环境配置 1.前提条件: ...

  2. Linux嵌入式 -- 内核 (arm) & 文件系统

    1. make distclean 2. 配置内核  ----> 生成 .config文件 make menuconfig ARCH=arm Makefile文件分析: 3.  编译内核 mak ...

  3. Flume的Avro Sink和Avro Source研究之二 : Avro Sink

    啊,AvroSink要复杂好多:< 好吧,先确定主要问题: AvroSink为啥这么多代码?有必要吗?它都有哪些逻辑需要实现? 你看,avro-rpc-quickstart里是这么建client ...

  4. JavaScrip 原生多文件上传及预览 兼容多浏览器

    JavaScrip 原生多文件上传及预览 兼容多浏览器 html代码块 <div class="container"> <label>请选择一个图像文件:& ...

  5. Struts2学习(1)

    struts2概述 1.struts2框架应用javaee三层结构中web层框架. 2.strut2框架在struts1和webwork基础之上发展全新的框架. 3.struts2解决的问题: 4.版 ...

  6. asp.net 基础知识

    1. DropDownList 的赋值 Response.Write(DropDownList1.Items.FindByText("潍坊").Value); Response.W ...

  7. (转)android webview用法小结

    原文地址:http://blog.csdn.net/ethan_xue/article/details/7841431 将webview里常用的东西拿出来分享下 想要webview加载页面,只需web ...

  8. pthread_getspecific()--读线程私有数据|pthread_setspecific()--写线程私有数据

    原型: #include <pthread.h> void *pthread_getspecific(pthread_key_t key); int pthread_setspecific ...

  9. CANopenSocket CANopenCommand.c hacking

    /***************************************************************************** * CANopenSocket CANop ...

  10. 【LeetCode】001. TwoSum

    题目: Given an array of integers, return indices of the two numbers such that they add up to a specifi ...