CentOS6系统yum源修改

XINAC
XINAC
XINAC
209
文章
9
评论
2021-04-1810:15:24
评论
340 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
关于HAProxy服务异常退出的解决办法 运维笔记

关于HAProxy服务异常退出的解决办法

HAProxy是一个使用C语言编写的自由及开放源代码软件,其提供高可用性、负载均衡,以及基于TCP和HTTP的应用程序代理。 HAProxy特别适用于那些负载特大的web站点,这些站点通常又需要会话保...
匿名

发表评论

匿名网友

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