* 0. yum报错 [Errno 14] curl#7 - "Failed connect to mirrors.aliyuncs.com:80; Connection refused"
# 使用默认yum源下载vim
[root@kid ~]# yum install vim -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
...
http://mirrors.aliyuncs.com/centos/7/os/x86_64/Packages/perl-Carp-1.26-244.el7.noarch.rpm: [Errno 14] curl#7 - "Failed connect to mirrors.aliyuncs.com:80; Connection refused"
Trying other mirror.
# 下载失败 报错 [Errno 14] curl#7 - "Failed connect to mirrors.aliyuncs.com:80; Connection refused"
Error downloading packages:
perl-Carp-1.26-244.el7.noarch: [Errno 256] No more mirrors to try.
perl-Encode-2.51-7.el7.x86_64: [Errno 256] No more mirrors to try.
* 1. 检查wget是否下载
# 该命令已经安装会提示使用方法
[root@kid ~]# wget
wget: missing URL
Usage: wget [OPTION]... [URL]...
Try `wget --help' for more options.
# 没有安装提示, 未找到命令
[root@kid ~]# wget
-bash: sssx: command not found
* 2. 安装wget
[root@kid ~]# yum install -y wget
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
...
* 3.切换到yum的配置文件目录
[root@kid ~]# cd /etc/yum.repos.d
[root@kid yum.repos.d]#
* 4. 下载163网易的yum源wget
命令: http://mirrors.163.com/.help/CentOS7-Base-163.repo
[root@kid yum.repos.d]# wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
--2022-08-28 16:43:14-- http://mirrors.163.com/.help/CentOS7-Base-163.repo
Resolving mirrors.163.com (mirrors.163.com)... 101.71.33.11
Connecting to mirrors.163.com (mirrors.163.com)|101.71.33.11|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1572 (1.5K) [application/octet-stream]
Saving to: ‘CentOS7-Base-163.repo’
100%[===========================>] 1,572 --.-K/s in 0s
2022-08-28 16:43:14 (94.3 MB/s) - ‘CentOS7-Base-163.repo’ saved [1572/1572]
# 查看下载
[root@kid yum.repos.d]# ls
CentOS7-Base-163.repo CentOS-Media.repo
CentOS-Base.repo.back CentOS-Sources.repo
CentOS-CR.repo CentOS-Vault.repo
CentOS-Debuginfo.repo CentOS-x86_64-kernel.repo
CentOS-fasttrack.repo
* 5. 将默认yum源修配置文件改名称
[root@kid yum.repos.d]# mv CentOS-Base.repo CentOS-Base.repo.back
* 6. 将网易云yum源配置文件名称改为默认源的名称
[root@kid yum.repos.d]# mv CentOS7-Base-163.repo CentOS-Base.repo
* 7. yum下载会依据CentOS-Base.repo配置配置去服务器下载软件...
如果替换源之后无法使用, 网易源删掉...
将默认源CentOS-Base.repo.back 替换回来, 改名去掉.back,
[root@kid yum.repos.d]# yum install vim -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
...
# 完成
Complete!
————————————————
文章的段落全是代码块包裹的, 留言是为了避免文章提示质量低.
文章的段落全是代码块包裹的, 留言是为了避免文章提示质量低.
文章的段落全是代码块包裹的, 留言是为了避免文章提示质量低.
文章的段落全是代码块包裹的, 留言是为了避免文章提示质量低.
文章的段落全是代码块包裹的, 留言是为了避免文章提示质量低.
文章的段落全是代码块包裹的, 留言是为了避免文章提示质量低.
文章的段落全是代码块包裹的, 留言是为了避免文章提示质量低.
文章的段落全是代码块包裹的, 留言是为了避免文章提示质量低.
文章的段落全是代码块包裹的, 留言是为了避免文章提示质量低.
文章的段落全是代码块包裹的, 留言是为了避免文章提示质量低.
————————————————