yum 源本地化
发布日期:2021-06-30 17:36:43 浏览次数:3 分类:技术文章

本文共 1047 字,大约阅读时间需要 3 分钟。

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 second step is to create the repo.

[root@localhost atomicdownload]# createrepo -p -d -o /tmp/atomicdownload /tmp/atomicdownloadSpawning worker 0 with 1 pkgsSpawning worker 1 with 0 pkgsWorkers FinishedSaving Primary metadataSaving file lists metadataSaving other metadataGenerating sqlite DBsSqlite 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_repobaseurl=file:///opt/da/da_yum_repoenabled=1gpgcheck=0gpgkey=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

转载地址:https://lemonstone.blog.csdn.net/article/details/100522084 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:CentOS 7如何配置yum源
下一篇:如何在centos或其他Linux系统中发现IP地址冲突

发表评论

最新留言

路过按个爪印,很不错,赞一个!
[***.219.124.196]2024年04月24日 23时19分41秒