不同linux系统修改yum源
1、centos6更换yum源和epel源
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-6.repo wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo yum clean all yum makecache
2、centos7更换yum源和epel源
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo yum clean all yum makecache
3、redhat更换yum源和epel源
#卸载redhat资源yum程序 rpm -qa | grep yum | xargs rpm -e --nodeps#下载安装软件包 wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-3.4.3-168.el7.centos.noarch.rpm wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-rhn-plugin-2.0.1-10.el7.noarch.rpm wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-54.el7_8.noarch.rpm wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm wget http://mirrors.163.com/centos/7/os/x86_64/Packages/rpm-4.11.3-45.el7.x86_64.rpm wget http://mirrors.163.com/centos/7/os/x86_64/Packages/rpm-libs-4.11.3-45.el7.x86_64.rpm wget http://mirrors.163.com/centos/7/os/x86_64/Packages/rpm-python-4.11.3-45.el7.x86_64.rpm wget http://mirrors.163.com/centos/7/os/x86_64/Packages/rpm-build-libs-4.11.3-45.el7.x86_64.rpm rpm -Uvh rpm-*.rpm #替换.repo文件中的$releasever版本为7 sed -i "s/\$releasever/7/g" /etc/yum.repos.d/CentOS-Base.repo yum install epel-release #检查yum源可用性 yum repolist && yum list all #yum update提示"Error: initscripts conflicts with redhat-release-server" yum check-update && yum update --skip-broken
最新评论
这篇文章写得深入浅出,让我这个小白也看懂了!
谢谢分享
域名CDN加速类型选择的什么类型?
好像很不错的材料
这招也不好使咋办啊
刚好公司要做培训,需要参考一下如何写,谢谢分享
可以可以
哪里下载呢