CentOS7使用‘中科大源’

这篇博客推荐了使用中科大源进行CentOS 7的软件安装,因为其具有良好的质量和速度。文章介绍了如何替换CentOS 7的Base和epel源,包括备份原有repo文件并创建新的repo配置。
摘要由CSDN通过智能技术生成

中科大的源质量速度都不错,推荐使用。

这里列出CentOS 7的Base和epel的源。

进入/etc/yum.repos.d/中,将原本的几个repo文件备份,之后新建三个repo文件

内容如下:

1.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
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=http://mirrors.ustc.edu.cn/centos/$releasever/os/$basearch/
gpgcheck=
在CentOS 7系统中更换本地通常是为了更快地获取软件包更新或者绕过某些地区网络限制。以下是更换为中国阿里云或其他镜像站的步骤: 1. **备份当前列表**: ``` sudo cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base-backup.repo ``` 2. **查找可用的国内镜像**: - 阿里云yum:https://help.aliyun.com/document_detail/yunhelp-en-us-yum-repo-centos.html?spm=a2c4g.11186623.6.605.1b6a7939WzjOqT 或者其他提供商如中科大、清华大学等都有yum。 3. **编辑yum配置文件**: 使用文本编辑器打开`/etc/yum.repos.d/CentOS-Base.repo`,替换原有的内容为新的镜像信息,例如阿里云的仓库地址可能如下: ```bash [base] name=CentOS-$releasever - Base mirrorlist=https://mirrors.aliyuncs.com/repo/CentOS-\$releasever/base/x86_64/repodata/primary.xml.gz enabled=1 gpgcheck=1 gpgkey=https://mirrors.aliyuncs.com/repo/CentOS-\$releasever/RPM-GPG-KEY-CentOS-\$releasever ``` 4. **保存并关闭文件**: ``` sudo vi +wq /etc/yum.repos.d/CentOS-Base.repo ``` 5. **刷新并检查新**: ``` sudo yum makecache fast yum repolist ``` 6. **设置默认**: 如果你想将这个新的设为默认,可以创建一个新的文件,比如 `/etc/yum.conf.d/my-local-repo.conf`,添加: ```bash priority=1 ``` 然后删除原默认行: ``` remove priorities= ``` 完成上述步骤后,你的CentOS 7系统就会从你选择的国内镜像下载软件包了。如果遇到问题,可以尝试清除缓存并重新加载配置: ``` sudo yum clean all sudo yum makecache ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值