在Linux系统中,镜像源是一个非常重要的概念,它就像是一座桥梁,连接了用户和软件仓库,使得用户可以方便地获取到所需的软件包,对于Linux发行版来说,选择合适的镜像源可以提高软件包的下载速度,提升系统的运行效率,本文将对常用的Linux发行版镜像源配置进行小结,帮助大家更好地理解和使用Linux系统。
Ubuntu镜像源配置
1、打开终端,输入以下命令备份原有的镜像源文件:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
2、使用文本编辑器打开镜像源配置文件:
sudo nano /etc/apt/sources.list
3、将官方推荐的镜像源地址替换为国内镜像源地址,例如阿里云镜像源:
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
4、保存并退出文本编辑器。
5、更新软件包列表:
sudo apt-get update
CentOS镜像源配置
1、安装wget工具:
sudo yum install wget -y
2、备份原有的镜像源文件:
sudo mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
3、下载阿里云镜像源文件:
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
4、清除缓存并生成新的缓存:
sudo yum clean all && sudo yum makecache
Fedora镜像源配置
1、打开终端,输入以下命令备份原有的镜像源文件:
sudo cp /etc/yum.repos.d/fedora.repo /etc/yum.repos.d/fedora.repo.bak
2、使用文本编辑器打开镜像源配置文件:
sudo nano /etc/yum.repos.d/fedora.repo
3、将官方推荐的镜像源地址替换为国内镜像源地址,例如阿里云镜像源:
[fedora] name=Fedora $releasever MediaStream Updates ($basearch) baseurl=http://mirrors.aliyun.com/fedora/$releasever/Everything/$basearch/os/$basearch/$releasever/$basearch/$releasever_updates/$basearch/$releasever_updates/$basearch/$releasever_updates_modular/$basearch/$releasever_updates_modular/$basearch/$releasever_updates_testing/$basearch/$releasever_updates_testing/$basearch/$releasever_updates_testing_modular/$basearch/$releasever_updates_testing_modular/$basearch/$releasever_rawhide/$basearch/$releasever_rawhide/$basearch/$releasever_rawhide_modular/$basearch/$releasever_rawhide_modular/$basearch/$releasever_development/$basearch/$releasever_development/$basearch/$releasever_development_modular/$basearch/$releasever_development_modular/$basearch/$releasever_devel/$basearch/$releasever_devel/$basearch/$releasever_devel_modular/$basearch/$releasever_devel_modular/$basearch/$releasever_extras/$basearch/$releasever_extras/$basearch/$releasever_extras_modular/$basearch/$releasever_extras_modular/$basearch/$releasever_enterprise/$basearch/$releasever_enterprise-debuginfo-common-x86_64-appstream-tools-source-rpms- oarch-debuginfo-common-x86_64-appstream-tools-source-rpms- oarch-debuginfo-common-x86_64-appstream-media-x86_64-debuginfo-common-x86_64-appstream-media-x86_64-debuginfo-common-x86_64-appstream-addons-x86_64-debuginfo-common-x86_64-appstream-addons-x86_64-debuginfo-testing-common-x86_64-appstream-tools-source-rpms-noarch-debuginfo-testing-common-x86_64-appstream-tools-source-rpms-noarch-debuginfo-testing-common-x86_64-appstream-media-x86_64-debuginfo-testing-common-x86_64-appstream-media-x86_64-debuginfo-testing-common-x86_64-appstream-addons-x86_64-debuginfo-testing-common-x86_64-appstream-addons-x86_64-debuginfo enabled=1 gpgcheck=0 baseurl=http://mirrors.aliyun.com/fedora/linux enabled=1 gpgcheck=0 baseurl=http://mirrors.aliyun.com/fedora/linux enabled=1 gpgcheck=0 baseurl=http://mirrors.aliyun.com/fedora/linux enabled=1 gpgcheck=0 baseurl=http://mirrors.aliyun.com/fedora/linux enabled=1 gpgcheck=0 baseurl=http://mirrors.aliyun.com/fedora/linux enabled=1 gpgcheck=0 baseurl=http://mirrors.aliyun.com/fedora/linux enabled=1 gpgcheck=0 baseurl=http://mirrors.aliyun.com/fedora/linux enabled=1 gpgcheck=0 baseurl=http://mirrors.aliyun.com/fedora/linux enabled=1 gpgcheck=0 baseurl=http://mirrors.aliyun.com/fedora/linux enabled=1 gpgcheck=0 baseurl=http://mirrors.aliyun.com/fedora/linux enabled=1 gpgcheck=0 baseurl=http://mirrors.aliyun.com/fedora/linux enabled=1 gpgcheck=0 baseurl=http://mirrors.aliyun.com/fedora/linux enabled=1 gpgcheck=0 baseurl=http://mirrors.aliyun.com/fedora/linux enabled=1 gpgcheck=0 baseurl=http://mirrors.aliyun.com/fedora/linux enabled=1 gpgcheck=0 baseurl=http://mirrors.aliyun.com/fedora/linux enabled=1 gpgcheck=0 baseurl=http://mirrors.aliyun.com/fedora/linux enabled=1 gpgcheck=0 baseurl=http://mirrors.aliy
原创文章,作者:K-seo,如若转载,请注明出处:https://www.kdun.cn/ask/327298.html