我的知识记录

国内服务器加速安装的方法?换源和镜像站的使用?

国内服务器软件加速的典型方案:
  1. 系统级换源
    • Ubuntu用sed -i 's/archive.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list
    • CentOS替换baseurl=http://mirrors.tencentyun.com/centos/$releasever
  2. 容器镜像加速
    • Docker配置"registry-mirrors": ["https://[阿里云镜像ID].mirror.aliyuncs.com"]
加速场景 推荐镜像源 配置检测
Python PIP -i https://pypi.tuna.tsinghua.edu.cn/simple pip config list
NPM npm config set registry https://registry.npmmirror.com npm get registry
Composer composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/ composer config -gl
Maven 修改settings.xml中的<mirror>标签 mvn help:effective-settings

国内服务器加速安装的方法?换源和镜像站的使用?

标签:网站服务器优化-软件源配置-镜像加速

更新时间:2025-06-20 18:02:56

上一篇:RESTful API设计如何避免415?标准请求头规范?

下一篇:宝塔账号密码忘了怎么办?有哪些解决方案?