如何将香港服务器centos系统更新yum为阿里云源?
在香港服务器中大部分用户使用的centos系统中很多都还没更新到yum的。那如何将香港的服务器系统跟换下yum
到阿里云上呢?下面我来讲解下如何更新
首先,第一步 将香港服务器centos系统自带的yum备份好
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
第二步 查看下当前的centos是什么版本的。
cat /etc/redhat-release
这里我的查看到是centos 7.7版本的。
第三步 使用命令更新为阿里云yum
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
(若无法实行,查看下在香港服务器中是不是没有安装到wget工具)
或者
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
若其他版本的可使用其他的命令
CentOS 6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
或者
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
或者
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
CentOS 8
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo
或者
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo
第四步 更新yum缓存。
使用yum makecache 更新
第五步更新完缓存后再升级下yum
Yum -y install update
之后测试下安装其他工具试试
Yum安装nfs服务测试下
yum -y install nfs-utils
到此,香港服务器即已经更新到阿里云源了。如若想了解更多可查询我司官网。