在香港服務(wù)器中大部分用戶使用的centos系統(tǒng)中很多都還沒更新到y(tǒng)um的。那如何將香港的服務(wù)器系統(tǒng)跟換下yum
到阿里云上呢?下面我來講解下如何更新
首先,第一步 將香港服務(wù)器centos系統(tǒng)自帶的yum備份好
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
第二步 查看下當(dāng)前的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
(若無法實(shí)行,查看下在香港服務(wù)器中是不是沒有安裝到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 更新
第五步更新完緩存后再升級(jí)下yum
Yum -y install update
之后測(cè)試下安裝其他工具試試
Yum安裝nfs服務(wù)測(cè)試下
yum -y install nfs-utils
到此,香港服務(wù)器即已經(jīng)更新到阿里云源了。如若想了解更多可查詢我司官網(wǎng)。