yum 找不到程序, yum更换国内阿里源

因为自己用刚VM安装的centos 7,使用yum安装程序的时候,发现一个程序都找不到,
我猜测可能是国外的yum源被限制了,然后换成国内的阿里yum源,就可以安装了。于是有了这个教程。

一、备份

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

二、下载新的CentOS-Base.repo 到/etc/yum.repos.d/

CentOS 5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
CentOS 6
wget -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

三、运行yum makecache生成缓存

一句句执行

yum clean all 
yum makecache
yum update

然后就可以用来安装程序了。

相关文章:

  • 2021-10-02
  • 2021-09-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-24
猜你喜欢
  • 2021-05-16
  • 2022-02-10
  • 2022-12-23
  • 2021-12-15
  • 2021-12-14
相关资源
相似解决方案