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. C - GCD LCM

    Description The GCD of two positive integers is the largest integer that divides both the integers w ...

  2. fiddler不同代理模式的区别

    Fiddler有不同的代理模式,分为以下两种: 流模式(Streaming)和缓冲模式(Buffering). 流模式可以理解为一种实时通信的模式,有请求就有返回,也就是实时返回. 缓冲模式是等所有请 ...

  3. 全面学习ORACLE Scheduler特性(9)创建Chains

    五.使用Chains 今天要来认识一位新同学:CHAIN(注意不要敲成CHINA).CHAIN可以被视做一组Programs的复合,举个简单的例子:运行PROGRAM:A以及PROGRAM:B,如果成 ...

  4. Android 简单的语音播报

    不解释快上车 Main.class package com.example.myapp; import android.app.AlertDialog;import android.os.Bundle ...

  5. 用DataReader 分页与几种传统的分页方法的比较

    对于数据库的分页,目前比较传统的方法是采用分页存储过程,其实用 DataReader 也可以实现分页,不需要写存储过程,实现效率上也比几种比较流行的分页方法要略快. 在开始这个方法之前,让我们先创建一 ...

  6. Java 基础入门随笔(4) JavaSE版——程序流程控制

    上一节对于运算符有了大致的了解,这一节针对程序流程控制进行复习!程序流程控制包括顺序结构.判断结构(if).选择结构(switch).循环结构. 1.判断结构 ①if语句的第一种格式:        ...

  7. java继承问题

    代码: 父类: public class Father { public Father() { System.out.println("基类构造函数{"); show(); new ...

  8. Codeforces_768_B_(二分)

    B. Code For 1 time limit per test 2 seconds memory limit per test 256 megabytes input standard input ...

  9. 413 Request Entity Too Large报错处理

    修改nginx配置   这是最简单的一个做法,着报错原因是nginx不允许上传配置过大的文件,那么件把nginx的上传大小配置调高就好.    1.打开nginx主配置文件nginx.conf,一般在 ...

  10. JAVA程序员面试笔试宝典3

    1.什么是线程?它与进程有什么区别?为什么要使用多线程 线程是指程序在执行过程中,能够执行程序代码的一个执行单元.进程是指一段正在执行的程序. 使用多线程可以减少程序的相应时间 与进程相比,线程的创建 ...