Centos5.11 使用yum源

 2023-09-13 阅读 20 评论 0

摘要:由于我是用的系统是Centos 5.11以停止更新很多年,故此yum也不能用,找了很多方法,最终yum能稳定的运行在Centos5.11上,下面开始一一讲解步骤: 如何创建本地yum源? 1:首先更新yum源 地址:http://vault.centos.org/ 修改yu

 

  由于我是用的系统是Centos 5.11以停止更新很多年,故此yum也不能用,找了很多方法,最终yum能稳定的运行在Centos5.11上,下面开始一一讲解步骤:

如何创建本地yum源? 

  1:首先更新yum源

地址:http://vault.centos.org/

修改yum源为本地源?网站是有各个版本镜像的,所以 通过lsb_release -a查询下,系统版本如图 

 下面是我的yum源完整版本,下面会说出具体针对系统版本进行修改yum源方法:

yum无法使用。 vim /etc/yum.repos.d/Centos-Base.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.
#
#[base]
name=CentOS-$releasever - Base
baseurl=http://vault.centos.org/5.11/os/x86_64/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#released updates 
[updates]
name=CentOS-$releasever - Updates
baseurl=http://vault.centos.org/5.11/os/x86_64/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever - Addons
baseurl=http://vault.centos.org/5.11/os/x86_64/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=http://vault.centos.org/5.11/os/x86_64/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
baseurl=http://vault.centos.org/5.11/os/x86_64/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
baseurl=http://vault.centos.org/5.11/os/x86_64/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

注:如果你的版本是5.10(举例说明),打开此网站,http://vault.centos.org,根据上述地址http://vault.centos.org/5.11/os/x86_64/来进行修改,比如系统是5.10的话,是x86_64的,我们可以修改成http://vault.centos.org/5.10/os/x86_64/,修改完成后,浏览器打开输入地址,看看是不是可以显示出以下页面:

yum linux? 

 如果显示出上述页面,那根据我上面的5.11版本的Centos源把baseurl=http://vault.centos.org/5.11/os/x86_64/ 修改成 baseurl=http://vault.centos.org/5.10/os/x86_64/(是上述文件内容中,所有http://vault.centos.org/5.11/os/x86_64/地址),即可

 修改完成后,保存,使用如下命令进行测试

yum用法? yum clean all

 yum makecache

 测试成功后,可用yum进行安装、卸载软件

centos 源, 

转载于:https://www.cnblogs.com/willamwang/p/10157290.html

版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。

原文链接:https://hbdhgg.com/5/50267.html

发表评论:

本站为非赢利网站,部分文章来源或改编自互联网及其他公众平台,主要目的在于分享信息,版权归原作者所有,内容仅供读者参考,如有侵权请联系我们删除!

Copyright © 2022 匯編語言學習筆記 Inc. 保留所有权利。

底部版权信息