yum源 epel源no package available更换国内yum源

mac2022-06-30  138

有时候安装软件会出现 no package available  

解决办法:yum install epel-release

安装完会在/etc/yum.repos.d/目录下下生成两个repo文件:

/etc/yum.repos.d/epel.repo              正式稳定版  /etc/yum.repos.d/epel-testing.repo  测试版软件,性能不稳定,有安全隐患

默认情况下,只有正式版是有效状态的,

如果你想试试测试版的话,需要修改/etc/yum.repos.d/epel-testing.repo,把enabled=0改成enabled=1即可。

如果你暂时不想使用EPEL的yum源的话,把对应文件里的enabled=1改成enabled=0就行了

如果你完全不需要了,那就直接卸载掉:

rpm -e epel-release

 

更换centos自带的yum源为阿里云的yum源,自带的源 地址在国外,下载速度慢

1、备份 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup 2、下载新的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

3、之后运行yum makecache生成缓存

 

参考地址http://mirrors.aliyun.com/help/centos

 

 

 

转载于:https://www.cnblogs.com/fanren224/p/8457324.html

最新回复(0)