CentOS6系统yum源修改

XINAC 2021-04-1810:15:24
评论
1,8731 2246字

CentOS6系统的yum源如果修改不对是无法在线更新的,各大镜像站包括原始安装包的配置已经不能更新成功了,同时也建议使用CentOS7或以上版本。

修改CentOS-Base.repo文件为以下内容即可,注意:6.10为目前的CentOS6的最后的版本,也可以修改为使用的对应版本。

修改原因:原始文件中使用$releasever标记版本号,在CentOS6系统中此值为6,但各大镜像站和官方镜像站已经没有名称为6的目录了,而是对应的详细的版本号,如6.10;所以原来的默认配置是无法更新的,必须修改才可以。

# 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

修改后保存并执行以下命令:

yum clean all
yum makecache

weinxin
新逸IT技术
扫一扫关注微信公众号
XINAC
  • 本文由 发表于 2021-04-1810:15:24
  • 转载请注明:https://www.xinac.net/9216.html
openssh升级教程 运维笔记

openssh升级教程

注意:升级openssh版本有风险,升级过程中不能中断!否则服务器有失联的风险。使用VPN连接远程操作的,网络不稳定的请勿操作。 按本教程操作,网络稳定的情况下,99%的都会成功。 网上很多教程先安装...
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定