fedora配置国内yum更新源/以配置163开源镜像为例

fedora自带的yum更新源有时更新很慢,只有几K的下载速度,所以配置国内的yum更新源是很有必要的。

公网网络里使用163开源镜像是一个很好的选择,http://mirrors.163.com/ ,里面有很多个项目的yum源,而且在最右一栏里还配有说明文档,按其中如下部分操作


使用说明

下载fedora-163.repofedora-updates-163.repo, 放入/etc/yum.repos.d/

运行yum makecache生成缓存

推荐操作方法,转到配置目录,wget下载这两个文件:

[root@fsc feng]# cd /etc/yum.repos.d
[root@fsc yum.repos.d]# wget http://mirrors.163.com/.help/fedora-163.repo
[root@fsc yum.repos.d]# wget http://mirrors.163.com/.help/fedora-updates-163.repo
[root@fsc yum.repos.d]# yum makecache

最后一步,yum makecache 速度比较慢,可能要花几分钟时间,慢慢等就是了。之后再运行yum安装更新等命令时,速度将有极加增加。

就个人使用,感觉163的源有时会缺少部分包,这时,还是要到其它源里下载,这时速度就不能保证了。

1. 使用官方 在 /etc/yum.repos.d/ 中创建一个新文件,例如 /etc/yum.repos.d/official.repo,然后将以下内容复制到该文件中: [official] name=Official CentOS $releasever Base baseurl=http://mirror.centos.org/$contentdir/$releasever/os/$basearch/ gpgcheck=1 gpgkey=http://mirror.centos.org/$contentdir/$releasever/os/$basearch/RPM-GPG-KEY-CentOS-$releasever 保存文件后,使用命令 yum update 来检查更新。 2. 使用第三方 许多第三方可供选择。以下是一些示例: - EPEL (Extra Packages for Enterprise Linux) : 在 /etc/yum.repos.d/ 中创建一个新文件,例如 /etc/yum.repos.d/epel.repo,然后将以下内容复制到该文件中: [epel] name=Extra Packages for Enterprise Linux 7 - $basearch baseurl=https://mirrors.tuna.tsinghua.edu.cn/epel/7/$basearch gpgcheck=1 gpgkey=https://mirrors.tuna.tsinghua.edu.cn/epel/RPM-GPG-KEY-EPEL-7 保存文件后,使用命令 yum update 来检查更新。 - RPM Fusion : 在 /etc/yum.repos.d/ 中创建一个新文件,例如 /etc/yum.repos.d/rpmfusion.repo,然后将以下内容复制到该文件中: [rpmfusion-free] name=RPM Fusion for Fedora $releasever - Free baseurl=https://mirrors.tuna.tsinghua.edu.cn/rpmfusion/free/fedora/releases/$releasever/Everything/$basearch/os/ enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-free-fedora-$releasever-$basearch [rpmfusion-nonfree] name=RPM Fusion for Fedora $releasever - Nonfree baseurl=https://mirrors.tuna.tsinghua.edu.cn/rpmfusion/nonfree/fedora/releases/$releasever/Everything/$basearch/os/ enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-nonfree-fedora-$releasever-$basearch 保存文件后,使用命令 yum update 来检查更新。 3. 使用国内镜像 许多国内镜像可供选择。以下是一些示例: - 清华大学开源软件镜像站: 在 /etc/yum.repos.d/ 中创建一个新文件,例如 /etc/yum.repos.d/tuna.repo,然后将以下内容复制到该文件中: [tuna] name=tuna baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/os/$basearch/ enabled=1 gpgcheck=0 保存文件后,使用命令 yum update 来检查更新。 - 阿里云开源镜像站: 在 /etc/yum.repos.d/ 中创建一个新文件,例如 /etc/yum.repos.d/aliyun.repo,然后将以下内容复制到该文件中: [aliyun] name=aliyun baseurl=https://mirrors.aliyun.com/centos/$releasever/os/$basearch/ enabled=1 gpgcheck=0 保存文件后,使用命令 yum update 来检查更新
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值