前提:

1)www或者ftp且可以访问

2)createrepo更新YUM数据库

[root@szm Downloads]# cd /media/CentOS_6.0_Final/repodata/

[root@szm repodata]# ls

2b014e1fcde80ec1cc69d6a048f260f712b1ae2d83d1fc04d3b3c00ade817ec9-primary.sqlite.bz2

509e08f6113733097d575739730e47783b85f94fe8cf449767364b8b8c7aba7b-other.xml.gz
-----包含每一个RPM包的附加信息,如修改日志

67e74ebb80b8882defa7712a4a7192a65bd68d33894f6013fca41f4954845aa1-c6-i386-comps.xml.gz
-----包含软件仓库内RPM包的信息

73a3b7e0741eba6cafa8d5404b02565060e7f2293caab10657074186c48e713b-c6-i386-comps.xml
-----记录目录内所有软件包的分组信息。

b4ccc345fa1c924fa1ab3841913be2c37507dc448b91f33f95e041c00b4bacfa-filelists.xml.gz

bc37813e8d9a5dd92784ba8149dc2995db7be4624207d56fe841bbf14187180f-primary.xml.gz

c639bc18e11e6e620b30b80fa43f69d830c08a1c1890b0dc5afed0028704ddc8-other.sqlite.bz2

d15a7119737517aa5f5a330d9da13336e537845f861a9757e0d211249e193836-filelists.sqlite.bz2

repomd.xml-----记录着其他三个文件的时间戳,一量客户端与服务器建立连接之后,它将缓存所有文件;如果软件仓库的信息发生变化之后,才会更新缓存信息。

TRANS.TBL

[root@szm repodata]# createrepo -h
Usage: genpkgmetadata.py [options]
Options:
--version             show program's version number and exit
-h, --help            show this help message and exit
-q, --quiet           output nothing except for serious errors
  -v, --verbose         output more debugging info.----显示数据库的更新过程
--profile             output timing/profile info.
-x EXCLUDES, --excludes=EXCLUDES
files to exclude
--basedir=BASEDIR     basedir for path to directories
-u BASEURL, --baseurl=BASEURL
baseurl to append on all files
  -g GROUPFILE, --groupfile=GROUPFILE------为仓库内的软件包建立分组信息
path to groupfile to include in metadata
-s SUMTYPE, --checksum=SUMTYPE
specify the checksum type to use (default: sha256)
-p, --pretty          make sure all xml generated is formatted
-c CACHEDIR, --cachedir=CACHEDIR
set path to cache dir
-C, --checkts         check timestamps on files vs the metadata to see if we
need to update
-d, --database        create sqlite database files: now default, see --no-
database to disable
--no-database         do not create sqlite dbs of metadata
--update              use the existing repodata to speed up creation of new
--update-md-path=UPDATE_MD_PATH
use the existing repodata  for --update from this path
--skip-stat           skip the stat() call on a --update, assumes if the
filename is the same then the file is still the same
(only use this if you're fairly trusting or gullible)
--split               generate split media
-i PKGLIST, --pkglist=PKGLIST
use only the files listed in this file from the
directory specified
-n INCLUDEPKG, --includepkg=INCLUDEPKG
add this pkg to the list - can be specified multiple
times
-o OUTPUTDIR, --outputdir=OUTPUTDIR
<dir> = optional directory to output to
-S, --skip-symlinks   ignore symlinks of packages
--changelog-limit=CHANGELOG_LIMIT
only import the last N changelog entries
--unique-md-filenames
include the file's checksum in the filename, helps
with proxies
--simple-md-filenames
do not include the file's checksum in the filename,
helps with proxies
--retain-old-md=RETAIN_OLD_MD
keep around the latest (by timestamp) N copies of the
old repodata
--distro=DISTRO       distro tag and optional cpeid:
--distro'cpeid,textname'
--content=CONTENT_TAGS
tags for the content in the repository
--repo=REPO_TAGS      tags to describe the repository itself
--revision=REVISION   user-specified revision for this repository
--deltas              create delta rpms and metadata
--oldpackagedirs=OLDPACKAGE_PATHS
paths to look for older pkgs to delta against
--num-deltas=NUM_DELTAS
the number of older versions to make deltas against
--read-pkgs-list=READ_PKGS_LIST
output the paths to the pkgs actually read useful with
--update
--max-delta-rpm-size=MAX_DELTA_RPM_SIZE
max size of an rpm that to run deltarpm against (in
bytes)
--workers=WORKERS     number of workers to spawn to read rpms
--xz                  use xz for repodata compression
--compress-type=COMPRESS_TYPE
which compression type to use

复制光盘到:/var/www/html目录内。
生成数据库信息:[root@szm ~]# createrepo -g /media/CentOS_6.0_Final/repodata/67e74ebb80b8882defa7712a4a7192a65bd68d33894f6013fca41f4954845aa1-c6-i386-comps.xml.gz .
配置repo文件即可;

转载于:https://blog.51cto.com/2816056/1154149

Linux常用命令笔记---创建私有YUM源相关推荐

  1. Linux 常用命令笔记

    Linux 常用命令笔记 1. locate locate:用来定位文件的位置,如:locate a.txt 但是这个命令有延迟,也就是新建的文件不一定能搜索到,如果非要找到新建的文件可以使用 upd ...

  2. Linux常用命令笔记---YUM

    软件包名称-软件包版本-软件包修订次数(3.el).适用的硬件平台.扩展名 [root@szm bash]# yum -h Loaded plugins: fastestmirror, priorit ...

  3. CentOS8 DNF简介 常用命令以及配置本地yum源

    欢迎关注我的个人博客 老王运维博客 专注于linux运维 ​ CentOS 8更改了软件包的安装程序,更改了传统的yum 的配置方法,从而使用了dnf 作为安装程序.虽然改变了软件包的安装方式,但是 ...

  4. linux常用命令笔记大全

    ===================目录操作======================== mkdir: 创建目录 -p : 递归的创建目录 也就是可以创建多层目录 一次创建多个目录: mkdir ...

  5. Linux 常用命令笔记

    1.mkdir : 创建目录,make directorys,-p 递归创建目录 mkdir-p /a/b/c 2.ls  : -l(long)d(directory)显示目录或文件,全称list - ...

  6. Linux常用命令笔记

    Linxu核心命令与文件管理 cd 命令 cd 语法 cd 可选的参数 文件夹几个特殊的目录 . 当前的工作目录 .. 上一级的工作目录 - 上一次的工作目录 ls list 列出文件夹中的内容 ls ...

  7. 新手小白 linux 常用命令笔记

    linux命令: reboot 重启 power off 关闭操作系统 ifconfig 查看ip地址 IP cd 切换目录 pwd 查看当前工作目录 mkdir 创建文件夹 -p 建立多级目录 rm ...

  8. Linux常用命令笔记与Windows部分命令

    Linux命令 1.帮助命令 1.1 man获得帮助信息 eg:查看ls命令的帮助信息 man ls 1.2 help获得shell内置命令的帮助信息 mv命令(移动文件或重命名) 重命名:(将文件f ...

  9. linux常用命令笔记(持续更新)

    xz文件解压 假设现在有个mysql.tar.xz文件,直接用tar命令解压肯定不行的,需要先用xz命令处理,再用tar -xvf命令解压 xz -d mysql.tar.xz tar -xvf my ...

最新文章

  1. 关于jConfirm回传的解决方案
  2. idea 升级到2020后 无法启动_【维修案例】2020年一汽奥迪Q5L发动机无法启动
  3. python发送邮箱_你知道怎么用Python发送邮件吗?
  4. 创建office一直转圈_Windows写字板出现广告条幅:推荐用户使用在线版Office
  5. Android WebView中那些不得不解决的坑~~
  6. 万字干货,eBPF 中文入门指南
  7. myeclipse10破解找不到common文件夹的问题
  8. 蓝鸽智慧计算机教室云服务平台操作说明,蓝鸽VDI云网络教室方案.pdf
  9. iview中Cascader组件的坑
  10. 用Keil工具搭建S3C2440编译环境
  11. Android中的工厂模式
  12. android opengl 简书,Android OpenGL入门
  13. RK3288 EDP 调试
  14. Mac将应用程序及其数据移到外接硬盘的步骤 #替身 #软链接
  15. JSP和Servlet是什么关系,JSP工作原理?
  16. 路由器DMZ简单解说
  17. 潘正磊谈微软研发团队管理和Visual Studio开发过程中的敏捷实践
  18. Eigen学习3:矩阵及向量运算
  19. PID控制算法基础知识
  20. 嵌入式软硬件开发区别

热门文章

  1. qt5变成内部头文件 ubuntu_Ubuntu下Visual Studio Code软件的安装和使用
  2. 【高危漏洞通告】Spring Framework 远程代码执行 (CVE-2022-22965)
  3. 垃圾回收算法与实现系列-String在虚拟机中的实现
  4. 用四张图说清楚Go程序调度的本质
  5. 亚马逊 html格式转换,亚马逊七种产品描述常用HTML代码,文字颜色代码让Listing更出彩...
  6. java图书商城项目介绍_JavaWeb网上图书商城完整项目--11.项目所需jquery函数介绍...
  7. kafka中生产者和消费者的分区问题
  8. 高铁车厢女童突然抽搐 护士为防其咬舌将手指放口中
  9. HanLP的自定义词典使用方式与注意事项介绍
  10. 【拓扑排序】确定比赛名次