CentOS 7 yum源


分享几个CentOS7的yum源, 每个做技术的总会经历各种各样的小白时刻,各种各样的窘况,下面分享一下自己的心得:情况如下,本人一不小心安装了最小化的CentOS 7,(就是没有CRT的上传下载工具,也没有 Wget),又是远程管理,突然间想远程安装一些软件,各种抓狂,想更新一下yum源,居然没有好的方 法 ,下载了阿里和网易的yum源,打开后会面临一个比较尴尬的问题,没有分行,没办法用CRP复制粘 贴,所以本文就给大家一个可以用CRT输进去的yum。

首先说明一下:CentOS 7新添加了一个模块(已加载插件:fastestmirror),这个模块可以自动识别 最近的yum源,不过还是不如写入的yum源速度快。
步骤如下:1:备份自有的yum源
cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.BK2:清空/etc/yum.repos.d/CentOS-Base.repo,等待新的yum源输入。echo “” >/etc/yum.repos.d/CentOS-Base.repo(当然我这只是个人习惯,也可删除后重建,或者用vi编辑器删除该命令的意思是 将一个空格追加到该文件中,并且覆盖之前文件)
3:用vi编辑器打开该文件/etc/yum.repos.d/CentOS-Base.repovi/etc/yum.repos.d/CentOS-Base.repo4:将下列文件粘贴进去(阿里yum)
# CentOS-Base.repo## The mirror system uses the connecting IP address of the client and the# update status of each mirror to pick mirrors that are updated to and# geographically close to the client. You should use this for CentOS updates# unless you are manually picking other mirrors.## If the mirrorlist= does not work for you, as a fall back you can try the# remarked out baseurl= line instead.##[base]name=CentOS-$releasever – Base – mirrors.aliyun.comfailovermethod=prioritybaseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/ http://mirrors.aliyuncs.com/centos/$releasever/os/$basearch/#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=osgpgcheck=1gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7#released updates[updates]name=CentOS-$releasever – Updates – mirrors.aliyun.comfailovermethod=prioritybaseurl=http://mirrors.aliyun.com/centos/$releasever/updates/$basearch/ http://mirrors.aliyuncs.com/centos/$releasever/updates/$basearch/#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updatesgpgcheck=1gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7#additional packages that may be useful[extras]name=CentOS-$releasever – Extras – mirrors.aliyun.comfailovermethod=prioritybaseurl=http://mirrors.aliyun.com/centos/$releasever/extras/$basearch/ http://mirrors.aliyuncs.com/centos/$releasever/extras/$basearch/#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extrasgpgcheck=1gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7#additional packages that extend functionality of existing packages[centosplus]name=CentOS-$releasever – Plus – mirrors.aliyun.comfailovermethod=prioritybaseurl=http://mirrors.aliyun.com/centos/$releasever/centosplus/$basearch/ http://mirrors.aliyuncs.com/centos/$releasever/centosplus/$basearch/#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplusgpgcheck=1enabled=0gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7#contrib – packages by Centos Users[contrib]name=CentOS-$releasever – Contrib – mirrors.aliyun.comfailovermethod=prioritybaseurl=http://mirrors.aliyun.com/centos/$releasever/contrib/$basearch/ http://mirrors.aliyuncs.com/centos/$releasever/contrib/$basearch/#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contribgpgcheck=1enabled=0gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-75.”:wq”退出后,使用yum makecache生成缓存,有可能会失败,这是因为有可能在配置网络的 时候D免费云主机域名NS为谷歌的8.8.8.8,该地址对国内个别网站的解析并不完美,所以会提示无法找到主机。
可以编辑/etc/resolv.conf 添加一条”nameserver 114.114.114.114″,别问为啥是这个DNS,因为好 记。6.yum makecache,然后记得yum install wget,然后想更换其他源可以直接用wget。不再举 例。

BUG:在CentOS 7里,修改/etc/resolv.conf,并不能永久修改DNS,不过可以写在网卡里,不过修 改网卡配置文件需要重启网卡才能生效,写在/etc/resolv.conf中会立马生效,在研究中,详情请见 后续博文。 备注:如有疑问请留言,如需转载请注明出处。

相关推荐: http安全证书如何免费申请

这篇文章将为大家详细讲解有关http安全证书如何免费申请,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这免费云主机域名篇文章后可以有所收获。一、什么是免费ssl证书?我们所说的免费ssl证书是会加强保密的,在此我也需要提醒大家一下,,加强和信任是不…

免责声明:本站发布的图片视频文字,以转载和分享为主,文章观点不代表本站立场,本站不承担相关法律责任;如果涉及侵权请联系邮箱:360163164@qq.com举报,并提供相关证据,经查实将立刻删除涉嫌侵权内容。

(0)
打赏 微信扫一扫 微信扫一扫
上一篇 01/29 11:51
下一篇 01/29 12:27