RHEL7配置yum源

配置yum源:
[root@warner ~]# umount /dev/sr0
[root@warner ~]# mount /dev/sr0 /mnt
mount: /dev/sr0 is write-protected, mounting read-only
[root@warner ~]# yum-config-manager --add-repo="file:///mnt"
Loaded plugins: langpacks, product-id
adding repo from: file:///mnt


[mnt]
name=added from: file:///mnt
baseurl=file:///mnt
enabled=1
 
[root@warner ~]# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release 
查询用哪个包:
[root@warner selinux]# yum provides seinfo
yum网络源配置
1.下载源地址文件
wget  http://mirrors.163.com/.help/CentOS6-Base-163.repo
只留第一个源即可,若都留下则可能出现多个源冲突的错误
可以不用加http: // mirrors.163.com /centos/7/os/x86_64/repodata/repomd.xml 
2.mv CentOS6-Base-163.repo rhel-source.repo
3.$releasever更改为centos的版本号
baseurl=http://mirrors.163.com/centos/6/os/$basearch/
下面的6改成7
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6==>
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6


用网上yum源安装软件步骤:
1.下载源地址文件
wget  http://mirrors.163.com/.help/CentOS6-Base-163.repo
2.打开CentOS6-Base-163.repo
vi CentOS6-Base-163.repo
删除19行以后的内容(:set nu显示行号)将光标定位到19行(19G),输入:dG
3.15行$releasever更改为centos的版本号,改为7,如下:
baseurl=http://mirrors.163.com/centos/7/os/$basearch/
下面18行的6改成7
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6==>
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-7
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值