您的位置:首页 > 运维架构 > Linux

1.2Centos6.5本地yum源配置

2015-12-05 00:10 351 查看
1、备份/etc/yum.repos.d/文件
[root@www ~]# cp -r /etc/yum.repos.d/ /etc/yum.repos.d.bak
[root@www ~]# ls /etc/yum.repos.d* -d
/etc/yum.repos.d /etc/yum.repos.d.bak

2.删除系统网络yum文件
[root@www ~]# rm -rf /etc/yum.repos.d/CentOS-Base.repo
[root@www ~]# yum repolist
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
repolist: 0

3.创建本地yum源配置文件
[root@www ~]# vim /etc/yum.repos.d/cdrom.repo
[cdrom]
name=cdrom
baseurl=file:///mnt/cdrom
gpgcheck=0
enable=1

4.虚拟机连接DVD,挂载光驱
[root@www ~]# mkdir /mnt/cdrom

[root@www ~]# mount /dev/sr0 /mnt/cdrom/
mount: block device /dev/sr0 is write-protected, mounting read-only

5.列出yum仓库[root@www ~]# yum repolist

[root@www ~]# yum install samba




6.删除yum进程 [root@www ~]# rm -f /var/run/yum.pid
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  yum源配置