centos7配置YUM源

配置YUM源
1、查看CD设备是否连接,右击打开快捷菜单,选择“设置”;(或右击打开快捷菜单,选择“可移动设备”>“CD/DVD(IDE)”>“连接”命令)
确定CD设备已连接
将CD设备挂载到/opt/centos目录下,命令如下;

[root@localhost ~]# mkdir /opt/centos
[root@localhost ~]# mount /dev/cdrom /opt/centos/
mount: /dev/sr0 is write-protected, mounting read-only
[root@localhost ~]# ll /opt/centos/
total 636
-r--r--r--. 1 root root     14 Dec  9  2015 CentOS_BuildTag
dr-xr-xr-x. 3 root root   2048 Dec  9  2015 EFI
-r--r--r--. 1 root root    215 Dec  9  2015 EULA
-r--r--r--. 1 root root  18009 Dec  9  2015 GPL
dr-xr-xr-x. 3 root root   2048 Dec  9  2015 images
dr-xr-xr-x. 2 root root   2048 Dec  9  2015 isolinux
dr-xr-xr-x. 2 root root   2048 Dec  9  2015 LiveOS
dr-xr-xr-x. 2 root root 612352 Dec  9  2015 Packages
dr-xr-xr-x. 2 root root   4096 Dec  9  2015 repodata
-r--r--r--. 1 root root   1690 Dec  9  2015 RPM-GPG-KEY-CentOS-7
-r--r--r--. 1 root root   1690 Dec  9  2015 RPM-GPG-KEY-CentOS-Testing-7
-r--r--r--. 1 root root   2883 Dec  9  2015 TRANS.TBL

2、配置本地YUM源文件,先将/etc/yum.repos.d/下的文件移走,然后创建local.repo文件,命令如下:

[root@localhost ~]# mv /etc/yum.repos.d/* /media/
[root@localhost ~]# vi /etc/yum.repos.d/local.repo
[root@localhost ~]# cat /etc/yum.repos.d/local.repo
[centos]
name=centos
baseurl=file:///opt/centos
gpgcheck=0
enabled=1

至此,YUM源配置完毕。

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值