Centos7配置网络源

Centos7配置网络源

此处选择阿里镜像源(国内源快些)

  • 复制对应版本的链接,此处选择Centos7,选用wget 方式 

 

  • yum install wget
[root@localhost yum.repos.d]# yum install wget
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package wget.x86_64 0:1.14-18.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================
 Package             Arch                  Version                    Repository              Size
===================================================================================================
Installing:
 wget                x86_64                1.14-18.el7                CentOS7                547 k

Transaction Summary
===================================================================================================
Install  1 Package

Total download size: 547 k
Installed size: 2.0 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : wget-1.14-18.el7.x86_64                                                         1/1
  Verifying  : wget-1.14-18.el7.x86_64                                                         1/1

Installed:
  wget.x86_64 0:1.14-18.el7

Complete!
  • wget  
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
--2020-05-09 17:56:09--  https://mirrors.aliyun.com/repo/Centos-7.repo
Resolving mirrors.aliyun.com (mirrors.aliyun.com)... 113.142.77.248, 113.142.38.184, 113.142.77.249, ...
Connecting to mirrors.aliyun.com (mirrors.aliyun.com)|113.142.77.248|:443... 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

2020-05-09 17:56:09 (249 MB/s) - ‘/etc/yum.repos.d/CentOS-Base.repo’ saved [2523/2523]
  • yum clean all && yum makecache
[root@localhost yum.repos.d]# yum clean all
Loaded plugins: fastestmirror
Cleaning repos: CentOS7 base extras updates
Cleaning up list of fastest mirrors
[root@localhost yum.repos.d]# yum makecache
Loaded plugins: fastestmirror
Determining fastest mirrors
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
Centos7                                                             | 3.6 kB  00:00:00
base                                                                | 3.6 kB  00:00:00
extras                                                              | 2.9 kB  00:00:00
updates                                                             | 2.9 kB  00:00:00
(1/14): Centos7/group_gz                                            | 166 kB  00:00:00
(2/14): Centos7/primary_db                                          | 6.0 MB  00:00:00
(3/14): Centos7/other_db                                            | 2.6 MB  00:00:00
(4/14): Centos7/filelists_db                                        | 7.1 MB  00:00:00
(5/14): base/7/x86_64/group_gz                                      | 153 kB  00:00:00
(6/14): base/7/x86_64/filelists_db                                  | 7.1 MB  00:00:01
(7/14): base/7/x86_64/primary_db                                    | 6.1 MB  00:00:01
(8/14): base/7/x86_64/other_db                                      | 2.6 MB  00:00:00
(9/14): extras/7/x86_64/primary_db                                  | 194 kB  00:00:00
(10/14): extras/7/x86_64/other_db                                   | 122 kB  00:00:00
(11/14): updates/7/x86_64/primary_db                                | 1.3 MB  00:00:01
(12/14): updates/7/x86_64/other_db                                  | 183 kB  00:00:00
(13/14): updates/7/x86_64/filelists_db                              | 980 kB  00:00:02
(14/14): extras/7/x86_64/filelists_db                               | 205 kB  00:00:05
Metadata Cache Created

之后就可以愉快的yum install * 了

-------------------------------------------------------------------------------------------------------返回目录

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值