yumのCentOSのは、国内のソースのソースを変更します

1、ヤムとしてのCentOSソースをインストールした後既定
LL /etc/yum.repos.d/
 
[ルート@ localhostの〜]#LL /etc/yum.repos.d/
合計32
-rw-rを - r--の。1つのルートルート1664年11月23日午前21時16分にCentOS-Base.repo
-rw-rを - r--の。1つのルートルート1309年11月23日午前21時16分にCentOS-CR.repo
-rw-rを - r--の。1つのルートルート649 11月23日21時16分にCentOS-Debuginfo.repo
-rw-rを - r--の。1つのルートルート314 11月23日21時16分にCentOS-fasttrack.repo
-rw-rを - r--の。1つのルートルート630 11月23日21時16分にCentOS-Media.repo
-rw-rを - r--の。1つのルートルート1331年11月23日午前21時16分にCentOS-Sources.repo
-rw-rを - r--の。1つのルートルート5701 11月23日午前21時16分にCentOS-Vault.repo
 
 
図2に示すように、デフォルトのバックアップ元ヤム(オプション)
 
[ルート@ localhostの〜]#ます。mkdir /opt/centos-yum.bak
[ルート@ localhostの〜]#mvの/etc/yum.repos.d/* /opt/centos-yum.bak/
 
 
 
3、163ヤムレポソースファイルをダウンロード
 
163出典:( http://mirrors.163.com/.help/centos.html ) -公式のアドレス
#各ファイルシステムのバージョンレポ対応するダウンロード操作
 
CentOSの6
wget -O /etc/yum.repos.d/CentOS6-Base-163.repo http://mirrors.163.com/.help/CentOS6-Base-163.repo
CentOS 7
wget -O /etc/yum.repos.d/CentOS7-Base-163.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo
 
阿里云的源:(https://opsx.alibaba.com/mirror)--官方地址
 
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
 
查看系统对应版本
[root@localhost ~]# cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)
 
下载对应的源文件:
[root@localhost ~]# wget -O /etc/yum.repos.d/CentOS7-Base-163.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo
--2019-05-18 18:40:02-- http://mirrors.163.com/.help/CentOS7-Base-163.repo
Resolving mirrors.163.com (mirrors.163.com)... 59.111.0.251
Connecting to mirrors.163.com (mirrors.163.com)|59.111.0.251|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1572 (1.5K) [application/octet-stream]
Saving to: ‘/etc/yum.repos.d/CentOS7-Base-163.repo’
 
100%[==============================================================================================================================>] 1,572 --.-K/s in 0s
 
2019-05-18 18:40:02 (186 MB/s) - ‘/etc/yum.repos.d/CentOS7-Base-163.repo’ saved [1572/1572]
 
 
 
清除缓存
# yum clean all
# yum makecache     把Yum源缓存到本地,加快软件的搜索好安装速度
# yum list         列出了yum包
# yum repolist
 
 
 
 
 
 

おすすめ

転載: www.cnblogs.com/jylee/p/10955400.html