CentOS6系统的yum源如果修改不对是无法在线更新的,各大镜像站包括原始安装包的配置已经不能更新成功了,同时也建议使用CentOS7或以上版本。
修改CentOS-Base.repo
文件为以下内容即可,注意:6.10为目前的CentOS6的最后的版本,也可以修改为使用的对应版本。文章源自新逸网络-https://www.xinac.net/9216.html
修改原因:原始文件中使用$releasever
标记版本号,在CentOS6系统中此值为6,但各大镜像站和官方镜像站已经没有名称为6的目录了,而是对应的详细的版本号,如6.10;所以原来的默认配置是无法更新的,必须修改才可以。文章源自新逸网络-https://www.xinac.net/9216.html
# CentOS-Base.repo # # The mirror system uses the connecting IP address of the client and the # update status of each mirror to pick mirrors that are updated to and # geographically close to the client. You should use this for CentOS updates # unless you are manually picking other mirrors. # # If the mirrorlist= does not work for you, as a fall back you can try the # remarked out baseurl= line instead. # # [base] name=CentOS-6.10 - Base #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/6.10/os/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 #gpgkey=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/6.10/os/$basearch/RPM-GPG-KEY-CentOS-6 #released updates [updates] name=CentOS-6.10 - Updates #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/6.10/updates/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 #additional packages that may be useful [extras] name=CentOS-6.10 - Extras #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/6.10/extras/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 #additional packages that extend functionality of existing packages [centosplus] name=CentOS-6.10 - Plus #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/6.10/centosplus/$basearch/ gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 #contrib - packages by Centos Users [contrib] name=CentOS-6.10 - Contrib #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib&infra=$infra baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-vault/6.10/contrib/$basearch/ gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
修改后保存并执行以下命令:文章源自新逸网络-https://www.xinac.net/9216.html
yum clean all yum makecache文章源自新逸网络-https://www.xinac.net/9216.html文章源自新逸网络-https://www.xinac.net/9216.html
新逸IT技术
扫一扫关注微信公众号
评论