如何使用安装光盘为本机创建yum repository
生活随笔
收集整理的這篇文章主要介紹了
如何使用安装光盘为本机创建yum repository
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
在CentOS 6上可以使用系統(tǒng)安裝光盤(pán)為本機(jī)創(chuàng)建yum repository,創(chuàng)建過(guò)程如下。
-
創(chuàng)建光盤(pán)mount點(diǎn)
[root@centos62 ~]# mkdir /media/CentOS
-
mount安裝盤(pán)
-
修改yum repository配置
yum repository的配置文件存儲(chǔ)在/etc/yum.repos.d目錄下,修改repos配置如下所示(紅色部分)
[root@centos62 ~]# cd /etc/yum.repos.d/[root@centos62 yum.repos.d]# more CentOS-Media.repo # CentOS-Media.repo # # This repo is used to mount the default locations for a CDROM / DVD on # CentOS-6. You can use this repo and yum to install items directly off the # DVD ISO that we release. # # To use this repo, put in your DVD and use it with the other repos too: # yum --enablerepo=c6-media [command] # # or for ONLY the media repo, do this: # # yum --disablerepo=\* --enablerepo=c6-media [command]
-
disable base repository
將base repository配置文件重命名
[root@centos62 yum.repos.d]# mv CentOS-Base.repo CentOS-Base.repo.disabled-
清除緩存并顯示repository
[root@centos62 yum.repos.d]# yum clean all Loaded plugins: fastestmirror Cleaning repos: c6-media Cleaning up Everything Cleaning up list of fastest mirrors[root@centos62 yum.repos.d]# yum repolist Loaded plugins: fastestmirror Determining fastest mirrors* c6-media: c6-media | 4.0 kB 00:00 ... c6-media/primary_db | 4.5 MB 00:00 ... repo id repo name status c6-media CentOS-6 - Media 6,294 repolist: 6,294
轉(zhuǎn)載于:https://www.cnblogs.com/cqubityj/p/3520782.html
總結(jié)
以上是生活随笔為你收集整理的如何使用安装光盘为本机创建yum repository的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 别惹农夫红袍法师奇异博士怎么解锁
- 下一篇: Flash怎么制作一片树叶飘落动画