createrepo简单使用

 

一环境说明

在99.48.236.64上测试

目录说明

1).制作的 yum 源根目录 /root/test/local-yum

2).yum源的下的packages /root/test/local-yum/Packages

二实践

1. 将rpm包拷贝至Packages目录下

[root@scctmpdev02101 Packages]# cp {samba*,httpd*} /root/test/local-yum/Packages/

[root@scctmpdev02101 Packages]# ll /root/test/local-yum/Packages/

total 54980

-r--r--r-- 1 root root 840348 Jan 22 17:45 httpd-2.2.15-26.el6.x86_64.rpm

-r--r--r-- 1 root root 153304 Jan 22 17:45 httpd-devel-2.2.15-26.el6.i686.rpm

-r--r--r-- 1 root root 153260 Jan 22 17:45 httpd-devel-2.2.15-26.el6.x86_64.rpm

-r--r--r-- 1 root root 801768 Jan 22 17:45 httpd-manual-2.2.15-26.el6.noarch.rpm

-r--r--r-- 1 root root 74040 Jan 22 17:45 httpd-tools-2.2.15-26.el6.x86_64.rpm

-r--r--r-- 1 root root 5291592 Jan 22 17:45 samba-3.6.9-151.el6.x86_64.rpm

-r--r--r-- 1 root root 366648 Jan 22 17:45 samba4-4.0.0-55.el6.rc4.x86_64.rpm

-r--r--r-- 1 root root 430140 Jan 22 17:45 samba4-client-4.0.0-55.el6.rc4.x86_64.rpm

-r--r--r-- 1 root root 625132 Jan 22 17:45 samba4-common-4.0.0-55.el6.rc4.x86_64.rpm

-r--r--r-- 1 root root 12208 Jan 22 17:45 samba4-dc-4.0.0-55.el6.rc4.x86_64.rpm

-r--r--r-- 1 root root 12240 Jan 22 17:45 samba4-dc-libs-4.0.0-55.el6.rc4.x86_64.rpm

-r--r--r-- 1 root root 271736 Jan 22 17:45 samba4-devel-4.0.0-55.el6.rc4.x86_64.rpm

-r--r--r-- 1 root root 4225800 Jan 22 17:45 samba4-libs-4.0.0-55.el6.rc4.x86_64.rpm

-r--r--r-- 1 root root 110128 Jan 22 17:45 samba4-pidl-4.0.0-55.el6.rc4.x86_64.rpm

-r--r--r-- 1 root root 1835808 Jan 22 17:45 samba4-python-4.0.0-55.el6.rc4.x86_64.rpm

-r--r--r-- 1 root root 73232 Jan 22 17:45 samba4-swat-4.0.0-55.el6.rc4.x86_64.rpm

-r--r--r-- 1 root root 1573800 Jan 22 17:45 samba4-test-4.0.0-55.el6.rc4.x86_64.rpm

-r--r--r-- 1 root root 386304 Jan 22 17:45 samba4-winbind-4.0.0-55.el6.rc4.x86_64.rpm

-r--r--r-- 1 root root 103140 Jan 22 17:45 samba4-winbind-clients-4.0.0-55.el6.rc4.x86_64.rpm

-r--r--r-- 1 root root 16860 Jan 22 17:45 samba4-winbind-krb5-locator-4.0.0-55.el6.rc4.x86_64.rpm

-r--r--r-- 1 root root 11370160 Jan 22 17:45 samba-client-3.6.9-151.el6.x86_64.rpm

-r--r--r-- 1 root root 10501248 Jan 22 17:45 samba-common-3.6.9-151.el6.i686.rpm

-r--r--r-- 1 root root 10533520 Jan 22 17:45 samba-common-3.6.9-151.el6.x86_64.rpm

-r--r--r-- 1 root root 2259588 Jan 22 17:45 samba-winbind-3.6.9-151.el6.x86_64.rpm

-r--r--r-- 1 root root 2112292 Jan 22 17:45 samba-winbind-clients-3.6.9-151.el6.i686.rpm

-r--r--r-- 1 root root 2114056 Jan 22 17:45 samba-winbind-clients-3.6.9-151.el6.x86_64.rpm

[root@scctmpdev02101 Packages]# ll /root/test/local-yum/

total 4

drwxr-xr-x 2 root root 4096 Jan 22 17:45 Packages

 

 

 

2 制定yum源的根目录生成repodata

[root@scctmpdev02101 ~]# createrepo /root/test/local-yum/

Spawning worker 0 with 26 pkgs

Workers Finished

Gathering worker results

 

Saving Primary metadata

Saving file lists metadata

Saving other metadata

Generating sqlite DBs

Sqlite DBs complete

 

[root@scctmpdev02101 ~]# ll /root/test/local-yum/

total 8

drwxr-xr-x 2 root root 4096 Jan 22 17:45 Packages

drwxr-xr-x 2 root root 4096 Jan 22 17:47 repodata

 

3测试新建的yum源是否可用

[root@scctmpdev02101 ~]# vim /etc/yum.repos.d/rhel_local.repo

[local-yum]

name=local-yum

baseurl=file:///root/test/local-yum/

enabled=1

gpgcheck=0

[root@scctmpdev02101 ~]# yum clean all

Loaded plugins: product-id, refresh-packagekit, security, subscription-manager

This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.

Cleaning repos: local-yum

Cleaning up Everything

[root@scctmpdev02101 ~]# yum makecache

Loaded plugins: product-id, refresh-packagekit, security, subscription-manager

This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.

local-yum | 2.9 kB 00:00 ...

local-yum/filelists_db | 20 kB 00:00 ...

local-yum/primary_db | 45 kB 00:00 ...

local-yum/other_db | 9.7 kB 00:00 ...

Metadata Cache Created

[root@scctmpdev02101 ~]# yum list available

Loaded plugins: product-id, refresh-packagekit, security, subscription-manager

This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.

Available Packages

httpd.x86_64 2.2.15-26.el6 local-yum

httpd-devel.i686 2.2.15-26.el6 local-yum

httpd-devel.x86_64 2.2.15-26.el6 local-yum

httpd-manual.noarch 2.2.15-26.el6 local-yum

httpd-tools.x86_64 2.2.15-26.el6 local-yum

samba-common.i686 3.6.9-151.el6 local-yum

samba4.x86_64 4.0.0-55.el6.rc4 local-yum

samba4-client.x86_64 4.0.0-55.el6.rc4 local-yum

samba4-common.x86_64 4.0.0-55.el6.rc4 local-yum

samba4-dc.x86_64 4.0.0-55.el6.rc4 local-yum

samba4-dc-libs.x86_64 4.0.0-55.el6.rc4 local-yum

samba4-devel.x86_64 4.0.0-55.el6.rc4 local-yum

samba4-libs.x86_64 4.0.0-55.el6.rc4 local-yum

samba4-pidl.x86_64 4.0.0-55.el6.rc4 local-yum

samba4-python.x86_64 4.0.0-55.el6.rc4 local-yum

samba4-swat.x86_64 4.0.0-55.el6.rc4 local-yum

samba4-test.x86_64 4.0.0-55.el6.rc4 local-yum

samba4-winbind.x86_64 4.0.0-55.el6.rc4 local-yum

samba4-winbind-clients.x86_64 4.0.0-55.el6.rc4 local-yum

samba4-winbind-krb5-locator.x86_64 4.0.0-55.el6.rc4 local-yum

posted on   石下江的太阳光  阅读(978)  评论(0编辑  收藏  举报

编辑推荐:
· 智能桌面机器人:用.NET IoT库控制舵机并多方法播放表情
· Linux glibc自带哈希表的用例及性能测试
· 深入理解 Mybatis 分库分表执行原理
· 如何打造一个高并发系统?
· .NET Core GC压缩(compact_phase)底层原理浅谈
阅读排行:
· 手把手教你在本地部署DeepSeek R1,搭建web-ui ,建议收藏!
· 新年开篇:在本地部署DeepSeek大模型实现联网增强的AI应用
· Janus Pro:DeepSeek 开源革新,多模态 AI 的未来
· 互联网不景气了那就玩玩嵌入式吧,用纯.NET开发并制作一个智能桌面机器人(三):用.NET IoT库
· 【非技术】说说2024年我都干了些啥

导航

< 2025年1月 >
29 30 31 1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31 1
2 3 4 5 6 7 8
点击右上角即可分享
微信分享提示