編碼的世界 / 優質文選 / 感情

CentOS7更換鏡像源


2022年7月28日
-   

1)先安裝wget 執行命令 yum install -y wget
[root@localhost ~]# yum install -y wget12) 查詢國內鏡像源
打開阿裏鏡像http://mirrors.aliyun.com/
點擊幫助:
3)下載CentOS 7的repo文件
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.repo1234)更新鏡像源
#清除緩存yum clean all #生成緩存yum makecache
執行命令:yum -y update
更新yum源,等待更新完畢即可。
1234[root@localhost ~]# yum clean allLoaded plugins: fastestmirrorCleaning repos: base extras updatesCleaning up everythingCleaning up list of fastest mirrors[root@localhost ~]# yum makecacheLoaded plugins: fastestmirrorbase | 3.6 kB 00:00:00 extras | 3.4 kB 00:00:00 updates | 3.4 kB 00:00:00 (1/12): base/7/x86_64/group_gz | 155 kB 00:00:00 (2/12): extras/7/x86_64/filelists_db | 770 kB 00:00:02 (3/12): extras/7/x86_64/primary_db | 151 kB 00:00:00 (4/12): extras/7/x86_64/other_db | 640 kB 00:00:07 (5/12): updates/7/x86_64/filelists_db .省略-
轉載於:https://www.cnblogs.com/gaodi2345/p/11214363.html

熱門文章