Centos7更换yum源

由于Centos7默认的yumm源在国外,访问速度较慢所以更新为阿里的yum源,提高速度。

[root@ansible-fcm ~]# cd /etc/yum.repos.d/ #保存本地yum的地方
[root@ansible-fcm yum.repos.d]# ll
total 4
-rw-r--r--. 1 root root 2523 Jun 15  2018 CentOS-Base.repo
[root@ansible-fcm yum.repos.d]# mv CentOS-Base.repo CentOS-Base.repo.bak #首先需要备份原来的文件,防止丢失
[root@ansible-fcm yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo #将下载的文件保存为/etc/yum.repos.d/CentOS-Base.repo
--2019-04-04 03:04:57--  http://mirrors.aliyun.com/repo/Centos-7.repo
Resolving mirrors.aliyun.com (mirrors.aliyun.com)... 183.60.159.231, 183.60.159.227, 183.60.159.225
Connecting to mirrors.aliyun.com (mirrors.aliyun.com)|183.60.159.231|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2523 (2.5K) [application/octet-stream]
Saving to: ‘/etc/yum.repos.d/CentOS-Base.repo’

100%[============================================================================================================================================================================>] 2,523       --.-K/s   in 0s      

2019-04-04 03:04:57 (309 MB/s) - ‘/etc/yum.repos.d/CentOS-Base.repo’ saved [2523/2523]

[root@ansible-fcm yum.repos.d]# yum makecache #更新yum
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com

Metadata Cache Created
[root@ansible-fcm yum.repos.d]# git --version
bash: git: command not found...
[root@ansible-fcm yum.repos.d]# yum -y install git #使用yum安装git
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com

Installed:
  git.x86_64 0:1.8.3.1-20.el7                                                                                                                                                                                         

Dependency Installed:
  perl-Error.noarch 1:0.17020-2.el7                                     perl-Git.noarch 0:1.8.3.1-20.el7                                     perl-TermReadKey.x86_64 0:2.30-20.el7                                    

Complete!
[root@ansible-fcm yum.repos.d]# git --version
git version 1.8.3.1

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值