标签:move 挂载 tab 搭建 metadata csdn 匹配 arc linux配置
1.放置iso文件,并挂载iso文件,永久挂载,修改/etc/fstab2.到该目录/etc/yum.repos.d删除所有文件rm -rf *,并创建base.repo
[bash]
name=my new repo
baseurl=file:///Archive/RedHat-Enterprise-Linux/7.4
enabled=1
gpgcheck=0
解读如下
[name] #括号中的名称为仓库源名称,要对应上,通常为字母和数字,必须填写
name=my new repo #对yum的描述,可写可不写
baseurl=file:///mnt/cdrom #baseurl表示声明yum可以管理并使用的rpm包路径,必须填写
enabled=1 #enabled表示当前仓库是否开启,1为开启,0为关闭,此项不写默认为开启
gpgcheck=0 #gpgcheck表示安装rpm包时,是否基于公私钥对匹配包的安全信息,1表示开启,
#0表示关闭,此项不写默认为验证
下面每一步都要做
3.清空
[root@localhost yum.repos.d]# yum clean all
Loaded plugins: product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Cleaning repos: base
Cleaning up everything
Maybe you want: rm -rf /var/cache/yum, to also free up space taken by orphaned data from disabled or removed repos
4.查看一下repolist
[root@localhost yum.repos.d]# yum repolist
Loaded plugins: product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
base | 4.1 kB 00:00
(1/2): base/group_gz | 137 kB 00:00
(2/2): base/primary_db | 4.0 MB 00:00
repo id repo name status
base Base 4,986
repolist: 4,986
5.yum包存储到本地
[root@localhost yum.repos.d]# yum makecache
Loaded plugins: product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
base | 4.1 kB 00:00
Metadata Cache Created
6.列出yum包
[root@localhost yum.repos.d]# yum list |wc -l
5096
标签:move 挂载 tab 搭建 metadata csdn 匹配 arc linux配置
原文地址:https://blog.51cto.com/weiruoyu/2453166