cxl
Published on 2025-02-28 / 47 Visits
7
0

系统镜像源

Ubuntu

配置路径

 /etc/apt/sources.list

先备份源文件

 cp /etc/apt/sources.list{,.backup}

清除源文件后或直接追加以下内容

	deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
	deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
	 
	deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
	deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
	 
	deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
	deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
	 
	deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
	deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse

以上内容是以阿里云的ubuntu22.04(即focal)版本镜像为主,也可更换为以下镜像列表中的任一镜像与版本:

版本,替换内容中的版本名 focal 即可:

  • 14.04: trusty

  • 16.04: xenial

  • 18.04: bionic

  • 20.04: focal

  • 22.04: jammy

  • 24.04: noble

更新软件

 apt-get update
 apt-get upgrade

CentOS

配置路径

 /etc/yum.repos.d/CentOS-Base.repo

具体操作,需管理员权限

先将源文件改名

 mv /etc/yum.repos.d/CentOS-Base.repo{,.backup}

下载对应源的repo源文件

如阿里云镜像源,如需要可替换下面链接中的centos版本号8:

 wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo

清除缓存并重新加载

 yum clean all
 yum makecache


Comment