Centos 6.x更换Valut源 手动换源

Centos 6.x更换Valut源 手动换源

如果是全新的系统没有wget或者是wget下载源失败的话,请自己手动换源
1、vi编辑/etc/yum.repos.d/目录下CentOS-Base.repo这个文件,直接把内容修改为源文件内容(直接复制过来即可)

vi /etc/yum.repos.d/CentOS-Base.repo

Centos官方

# 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 - vault.centos.org
failovermethod=priority
baseurl=http://vault.centos.org/6.10/os/$basearch/
gpgcheck=1
gpgkey=http://vault.centos.org/RPM-GPG-KEY-CentOS-6
 
#released updates 
[updates]
name=CentOS-6
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
更换 CentOS 8.5.2111 的 yum ,可以按照以下步骤进行操作: 1. 打开终端,使用 root 权限登录。 2. 备份原始的 yum 文件,以防止操作不当造成问题: ``` cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak ``` 3. 使用编辑器(如 vi 或 nano)打开 yum 文件: ``` vi /etc/yum.repos.d/CentOS-Base.repo ``` 4. 注释掉原始的镜像配置,将其内容修改为如下所示: ```bash [BaseOS] name=CentOS-$releasever - Base baseurl=https://mirrors.cloud.tencent.com/centos/$releasever/BaseOS/$basearch/os/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial #released updates [AppStream] name=CentOS-$releasever - AppStream baseurl=https://mirrors.cloud.tencent.com/centos/$releasever/AppStream/$basearch/os/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial #additional packages that may be useful [Extras] name=CentOS-$releasever - Extras baseurl=https://mirrors.cloud.tencent.com/centos/$releasever/Extras/$basearch/os/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial #additional packages that extend functionality of existing packages [PowerTools] name=CentOS-$releasever - PowerTools baseurl=https://mirrors.cloud.tencent.com/centos/$releasever/PowerTools/$basearch/os/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial #contrib - packages by Centos Users [Contrib] name=CentOS-$releasever - Contrib baseurl=https://mirrors.cloud.tencent.com/centos/$releasever/Contrib/$basearch/os/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial ``` 这里使用了腾讯云的镜像,你也可以选择其他可靠的。 5. 保存并关闭文件。 6. 清除缓存并生成新的缓存: ``` yum clean all yum makecache ``` 7. 完成后,你应该已经成功更换CentOSyum

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值