First of all, you need to prepare the rpm packages, we can download them with yum command, in that way, the dependencies needed by the rpm will also be downloaded.

For example, you are trying to download memcached rpm

yum install --downloadonly --downloaddir=/tmp/atomicdownload memcached

The above command will download the corresponding rpm packages into /tmp/atomicdownload directory.

The second step is to create the repo.

[root@localhost atomicdownload]# createrepo -p -d -o /tmp/atomicdownload /tmp/atomicdownload
Spawning worker with pkgs
Spawning worker with pkgs
Workers Finished
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete

-p means pretty output

-d means database

-o means output

The last step is to edit the repo file.

vi /etc/yum.repos.d/CentOS-Base.repo

The file content is like below:

[base]
name=da_repo
baseurl=file:///opt/da/da_yum_repo
enabled=
gpgcheck=
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

The important configuration is

baseurl  which is the url pointing to the repository

enabled=1 will set this repository active

gpgcheck=0 disable the check

problem

When I try to download from DVD Repo. The downloading always failed. Dont know why

yum 源本地化 (one)的更多相关文章

  1. yum 源本地化 (two)

    之前写过一个yum源本地化的文章. 后来发现那个方法有些缺陷, yum install --downloadonly --downloaddir=/tmp/atomicdownload memcach ...

  2. 配置 EPEL yum 源

    当我们在linux上, 使用yum 安装包时,报错如下: Loaded plugins: product-id, refresh-packagekit, security, subscription- ...

  3. (转载)centos yum源的配置和使用

    原文地址:http://www.cnblogs.com/mchina/archive/2013/01/04/2842275.html 一.yum 简介 yum,是Yellow dog Updater, ...

  4. 阿里云yum源安装

      1.先清理掉yum.repos.d下面的所有repo文件 [root@localhost yum.repos.d]# rm -rf * 2.下载repo文件  wget http://mirror ...

  5. centos本地yum源安装

    1.为DVD或U盘创建一个用于挂载的目录 [root@localhost ~]# mkdir /media/CentOS/ 2.查看DVD或U盘所在的路径 [root@localhost ~]# fd ...

  6. CentOS yum 源的配置与使用

    一.yum 简介 yum,是Yellow dog Updater, Modified 的简称,是杜克大学为了提高RPM 软件包安装性而开发的一种软件包管理器.起初是由yellow dog 这一发行版的 ...

  7. Linux下更换默认yum源为网易yum源的操作记录

    废话不多说,下面记录了centos下更换系统默认yum源为网易yum源的操作过程:1)备份原有的默认yum源[root@bastion-IDC ~]# cp /etc/yum.repos.d/Cent ...

  8. CentOS系统yum源使用报错:Error: Cannot retrieve repository metadata (repomd.xml) for repository: rpmforge.

    服务器上的yum突然不好使用,使用yum的时候报错如下:[root@bastion-IDC src]# yum list......Could not retrieve mirrorlist http ...

  9. centos6.5 更新yum源

    在使用centos过程中,自带的yum源包,不能满足的情况下,这个时候就可以考虑升级yum源了.国内用的比较多的是163镜像地址为http://mirrors.163.com/.help/centos ...

随机推荐

  1. 网站开发综合技术 三 JavaScript的DOM操作

    第3部分 JavaScript的DOM操作 1.DOM的基本概念 DOM是文档对象模型,这种模型为树模型:文档是指标签文档:对象是指文档中每个元素:模型是指抽象化的东西. 2.Windows对象操作 ...

  2. Git学习笔记(2)-创建仓库

    一.Git简介 1.Git是什么 Git是分布式版本控制系统 2.Git有什么特点 (1)Git是分布式的SCM,SVN是集中式的 (2)Git每个历史版本存储完整的文件,SVN存储文件差异 (3)G ...

  3. Spring.Net学习笔记(二)-数据访问器

    Spring对ADO.NET也提供了支持,依赖与程序集Spring.Data.dll IDbProvider IDbProvider定义了数据访问提供器的基础,配置如下 <?xml versio ...

  4. 配置JDK、tomcat及Java Web项目部署

    一.JDK的安装 (1)下载安装JDK: 这个就不用说了,直接官网下载jdk安装即可.http://www.oracle.com/technetwork/java/javaee/downloads/i ...

  5. [ 东莞市选 2008 ] GCD&LCM

    \(\\\) \(Description\) 给出两数的\(GCD\)和\(LCM\),求合法的两数之差的绝对值最小是多少. \(GCD\times LCM\le10^{18}\) \(\\\) \( ...

  6. js中获取class封装

    1.封装 //封装getClass function getClass(tagName,className) //获得标签名为tagName,类名className的元素 { if(document. ...

  7. DVWA--登录页面错误问题 469 | | PHP Fatal error: Uncaught exception 'PDOException' with message 'could not find driver' in C:\web\DVWA\dvwa\includes\dvwaPage.inc.php:469

    // MySQL PDO Prepared Statements (for impossible levels) $db = new PDO('mysql:host=' . $_DVWA[ 'db_s ...

  8. dutacm.club_1094_等差区间_(线段树)(RMQ算法)

    1094: 等差区间 Time Limit:5000/3000 MS (Java/Others)   Memory Limit:163840/131072 KB (Java/Others)Total ...

  9. HDU_2955_Robberies_01背包

    A - Robberies Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submi ...

  10. 【linux】 下根目录,家目录区别,以及普通用户到root用户的切换

    一:家目录 一般普通用户,家目录是/home/用户名 root用户,家目录是/root root登录系统,执行如下命令进入root的家目录 cd /cd ~ 进入家目录后执行如下命令获取具体路径 pw ...