搭建本地光盘yum源
[root@localhost ~]#mkdir /mnt/cdrom
#创建cdrom目录,作为光盘的挂载点
[root@localhost ~]#mount -t iso9660 /dev/cdrom1 /mnt/cdrom/
mount: block device /dev/sr0 is write-protected mounting read-only
#挂载光盘到/mnt/cdrom目录下
[root@localhost ~]#cd /etc/yum.repos.d/
[root@localhost yum.repos.d]#mv *.repo backup/
[root@localhost ~]# vim /etc/yum.repos.d/backup/CentOS-Media.repo
[c6-media]
name=CentOS-$releasever - Media
baseurl=file:///media/CentOS_6.6_Final/
file:///media/cdrom/
file:///dev/cdrom1
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
[root@localhost yum.repos.d]# yum clean all
已加载插件:fastestmirror, refresh-packagekit, security
Cleaning repos: demo
清理一切
[root@localhost yum.repos.d]# yum makecache
已加载插件:fastestmirror, refresh-packagekit, security
Determining fastest mirrors
demo
| 4.0 kB 00:00 ... demo/group_gz | 216 kB 00:00 ... demo/filelists_db
| 6.0 MB 00:00 ... demo/primary_db
| 4.5 MB 00:00 ... demo/other_db | 2.8 MB 00:00 ...
元数据缓存已建立
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。