当前位置: 首页 > news >正文

Linux 修改国内镜像源

一、Ubantu

1、备份系统源文件

sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

2、编辑源文件

sudo vi /etc/apt/sources.list

3、直接输入49dd,清除所有内容
4、粘贴国内源

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-proposed main restricted universe multiverse
deb-src 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-backports main restricted universe multiverse

5、更新源

sudo apt-get -y update && sudo apt-get -y upgrade

二、CentOS 7

1、备份系统源文件

sudo cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

2、下载清华大学镜像源文件

sudo wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.tuna.tsinghua.edu.cn/help/centos/

3、清理缓存并更新软件包

sudo yum clean all
sudo yum makecache

三、CentOS 8

sudo cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

2、下载清华大学镜像源文件

sudo wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.tuna.tsinghua.edu.cn/help/centos/

3、清理缓存并更新软件包

sudo dnf clean all
sudo dnf makecache
http://www.dtcms.com/a/80624.html

相关文章:

  • 基于Debian搭建FTP服务器
  • 腾讯云创建DeepSeek AI应用及使用教程
  • 人工智能和量子时代的网络安全
  • 类与对象(二)——类的 6 个默认成员函数
  • 模型空间、图纸空间、布局(Layout)之间联系——CAD c#二次开发
  • Java面试第十二山!《Redis缓存》
  • resnet与densenet的比较
  • 甘特图dhtmlx-gantt 一行多任务
  • MySQL-索引的使用
  • Docker Swarm集群搭建
  • 自然语言处理|深入解析 PEGASUS:从原理到实践
  • 电脑节电模式怎么退出 分享5种解决方法
  • ssh命令
  • 负载均衡的在线OJ项目
  • Redis核心机制(一)
  • 【智能体】| 知识库、RAG概念区分以及智能体是什么
  • 大数据学习(77)-Hive详解
  • 深度洞察:DeepSeek 驱动金融行业智能化转型变革
  • Nginx参数调优脚本
  • 基于springboot的免税商品优选购物商城(020)
  • Java面试黄金宝典5
  • MySql 存储引擎 InnoDB 与 MyISAM 有什么区别
  • 知识库项目开场白
  • 【Linux】线程同步与生产消费者模型
  • Qt6.8.2中JavaScript调用WebAssembly的js文件<2>
  • Redis JSON 用id读取content总结(sendCommand())
  • VLLM专题(二十一)—分布式推理与服务
  • Unity URPShader:实现和PS一样的色相/饱和度调整参数效果
  • MarsCode AI实战:利用DeepSeek 快速搭建你的口语学习搭子
  • HttpClient通讯时间过久