CentOS低版本更换更新源-Vault.repo

3,978次阅读
没有评论

共计 3445 个字符,预计需要花费 9 分钟才能阅读完成。

CentOS低版本更换更新源-Vault.repo

CentOS低版本更换更新源-Vault.repo

CentOS低版本更换更新源-Vault.repo

1、查询本地已有Vault.repo文件
CentOS低版本更换更新源-Vault.repo
2、复制该文件最后面CentOS6的相关镜像源信息;这儿的CentOS版本根据你当时该系统安装时啥版本这儿就显示啥版本,例如当时安装的是CentOS6.6这儿最后显示的就是6.6;

[C6.6-base]
name=CentOS-6.6 - Base
baseurl=http://vault.centos.org/6.6/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=0

[C6.6-updates]
name=CentOS-6.6 - Updates
baseurl=http://vault.centos.org/6.6/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=0

[C6.6-extras]
name=CentOS-6.6 - Extras
baseurl=http://vault.centos.org/6.6/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=0

[C6.6-contrib]
name=CentOS-6.6 - Contrib
baseurl=http://vault.centos.org/6.6/contrib/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=0

[C6.6-centosplus]
name=CentOS-6.6 - CentOSPlus
baseurl=http://vault.centos.org/6.6/centosplus/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=0

3、以防出错先备份CentOS-Base.repo源文件,然后把该文件内的源信息删除掉并粘贴刚刚复制Vault.repo文件的源信息

# 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.
#
#
[C6.6-base]
name=CentOS-6.6 - Base
baseurl=http://vault.centos.org/6.6/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=0

[C6.6-updates]
name=CentOS-6.6 - Updates
baseurl=http://vault.centos.org/6.6/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=0

[C6.6-extras]
name=CentOS-6.6 - Extras
baseurl=http://vault.centos.org/6.6/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=0

[C6.6-contrib]
name=CentOS-6.6 - Contrib
baseurl=http://vault.centos.org/6.6/contrib/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=0

[C6.6-centosplus]
name=CentOS-6.6 - CentOSPlus
baseurl=http://vault.centos.org/6.6/centosplus/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=0

4、根据YUM规范修改仓库命名、根据当前系统版本相应的修改系统版本号及标示名称、并且启用仓库。

# 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.8 - Base
baseurl=http://vault.centos.org/6.8/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=1

[updates]
name=CentOS-6.8 - Updates
baseurl=http://vault.centos.org/6.8/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=1

[extras]
name=CentOS-6.8 - Extras
baseurl=http://vault.centos.org/6.8/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=1

[contrib]
name=CentOS-6.8 - Contrib
baseurl=http://vault.centos.org/6.8/contrib/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=1

[centosplus]
name=CentOS-6.8 - CentOSPlus
baseurl=http://vault.centos.org/6.8/centosplus/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
enabled=1

5、清除旧缓存创建新缓存: yum clean all && yum makecache
CentOS低版本更换更新源-Vault.repo

正文完
 0
yvan
版权声明:本站原创文章,由 yvan 于2020-12-04发表,共计3445字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
评论(没有评论)