Centos 8如何选择更快的软件源 - 开发说
当前位置: 主页 » Centos » Centos 8如何选择更快的软件源

Centos 8如何选择更快的软件源

      2020年06月14日   阅读 973 次     0 评论   Tags: ·

在Centos7系统中有个firstmirror插件,可以让系统选择更快的软件源,但是在Centos8已没有这个插件,我们可以通过修改dnf.conf文件来实现让系统选择更快的软件源。
Centos 8配置系统自动更新
在VirtualBox通过boot.iso安装体验Centos8
在Centos Linux 8 中使用dnf包管理工具
在VirtualBox安装体验Centos Linux 8

1、在/etc/dnf/dnf.conf 加入 fastestmirror=true


[root@uscdn3 ~]# vi /etc/dnf/dnf.conf 

[main]
gpgcheck=1
installonly_limit=3
clean_requirements_on_remove=True
best=True
fastestmirror=true

2、清理dnf缓存并重新生成缓存


[root@uscdn3 ~]# dnf clean all
46 files removed

[root@uscdn3 ~]# dnf makecache
CentOS-8 - AppStream                                                                         9.9 MB/s | 7.0 MB     00:00    
CentOS-8 - Base                                                                              4.0 MB/s | 2.2 MB     00:00    
CentOS-8 - Extras                                                                             26 kB/s | 6.7 kB     00:00    
MariaDB                                                                                      493 kB/s | 502 kB     00:01    
ELRepo.org Community Enterprise Linux Kernel Repository - el8                                1.1 MB/s | 945 kB     00:00    
nginx stable repo                                                                             24 kB/s |  15 kB     00:00    
Zabbix Official Repository - x86_64                                                          263 kB/s |  25 kB     00:00    
Zabbix Official Repository non-supported - x86_64                                             14 kB/s | 1.2 kB     00:00    
Metadata cache created.

3、测试一下效果:



[root@uscdn3 ~]# dnf  reinstall  gcc gcc-c++
Last metadata expiration check: 0:00:28 ago on Sun 14 Jun 2020 09:25:42 PM HKT.
Dependencies resolved.
=============================================================================================================================
 Package                    Architecture              Version                             Repository                    Size
=============================================================================================================================
Reinstalling:
 gcc                        x86_64                    8.3.1-4.5.el8                       AppStream                     23 M
 gcc-c++                    x86_64                    8.3.1-4.5.el8                       AppStream                     12 M

Transaction Summary
=============================================================================================================================

Total download size: 36 M
Installed size: 90 M
Is this ok [y/N]: y
Downloading Packages:
(1/2): gcc-c++-8.3.1-4.5.el8.x86_64.rpm                                                       11 MB/s |  12 MB     00:01    
(2/2): gcc-8.3.1-4.5.el8.x86_64.rpm                                                           14 MB/s |  23 MB     00:01    
-----------------------------------------------------------------------------------------------------------------------------
Total                                                                                         19 MB/s |  36 MB     00:01     
Running transaction check

  • 版权声明:本文版权归开发说和原作者所有,未经许可不得转载。文章部分来源于网络仅代表作者看法,如有不同观点,欢迎进行交流。除非注明,文章均由 开发说 整理发布,欢迎转载,转载请带版权。

  • 来源:开发说 ( https://www.kaifashuo.com/ ),提供主机优惠信息深度测评和服务器运维编程技术。
  • 链接:https://www.kaifashuo.com/1924.html
  • 评论(0

    1. 还没有任何评论,你来说两句吧

    发表回复

    您的电子邮箱地址不会被公开。 必填项已用 * 标注