maven、npm、pip、yum官方镜像修改文档

文章目录

由于各博客繁杂,本文旨在记录各常见镜像官网,及其配置文档。常用镜像及配置可评论后加入

Maven

阿里云

官方文档

setting.xml

xml 复制代码
<mirror>
    <id>aliyunmaven</id>
    <mirrorOf>*</mirrorOf>
    <name>阿里云公共仓库</name>
    <url>https://maven.aliyun.com/repository/public</url>
</mirror>

或者pom.xml

xml 复制代码
<repository>
    <id>spring</id>
    <url>https://maven.aliyun.com/repository/spring</url>
    <releases>
        <enabled>true</enabled>
    </releases>
    <snapshots>
        <enabled>true</enabled>
    </snapshots>
</repository>

网易

官方文档

setting.xml

xml 复制代码
<mirror>
    <id>nexus-163</id>
    <mirrorOf>*</mirrorOf>
    <name>Nexus 163</name>
    <url>http://mirrors.163.com/maven/repository/maven-public/</url>
</mirror>

或者pom.xml

xml 复制代码
<repositories>
    <repository>
        <id>nexus-163</id>
        <name>Nexus 163</name>
        <url>http://mirrors.163.com/maven/repository/maven-public/</url>
        <layout>default</layout>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
        <releases>
            <enabled>true</enabled>
        </releases>
    </repository>
</repositories>
<pluginRepositories>
    <pluginRepository>
        <id>nexus-163</id>
        <name>Nexus 163</name>
        <url>http://mirrors.163.com/maven/repository/maven-public/</url>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
        <releases>
            <enabled>true</enabled>
        </releases>
    </pluginRepository>
</pluginRepositories>

华为

官方文档
PDF

setting.xml

xml 复制代码
<mirror>
    <id>huaweicloud</id>
    <mirrorOf>*</mirrorOf>
    <url>https://repo.huaweicloud.com/repository/maven/</url>
</mirror>

腾讯云

官方文档

setting.xml

xml 复制代码
<mirror>
    <id>nexus-tencentyun</id>
    <mirrorOf>*</mirrorOf>
    <name>Nexus tencentyun</name>
    <url>https://mirrors.tencent.com/nexus/repository/maven-public/</url>
 </mirror> 

Npm

淘宝

官方文档

shell 复制代码
npm config set registry https://registry.npmmirror.com

cnpm

shell 复制代码
npm install -g cnpm --registry=https://registry.npmmirror.com

腾讯云

官方文档

shell 复制代码
npm config set registry https://mirrors.tencent.com/npm/

pip

清华源

官方文档

临时使用

shell 复制代码
pip install -i https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple some-package

设为默认

shell 复制代码
pip config set global.index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple

阿里

官方文档

a. 找到下列文件

xml 复制代码
~/.pip/pip.conf

b. 在上述文件中添加或修改:

xml 复制代码
[global]
index-url = http://mirrors.aliyun.com/pypi/simple/

[install]
trusted-host=mirrors.aliyun.com

中科大

官方文档

临时使用

shell 复制代码
pip install -i https://mirrors.ustc.edu.cn/pypi/simple package

设为默认

升级 pip 到最新的版本 (>=10.0.0) 后进行配置:

使用本镜像站来升级 pip

shell 复制代码
pip install -i https://mirrors.ustc.edu.cn/pypi/simple pip -U
pip config set global.index-url https://mirrors.ustc.edu.cn/pypi/simple

华科

官方文档

shell 复制代码
curl -sSfL https://mirrors.hust.edu.cn/get | sh -s -- autodeploy #或者采用 ad

Yum

官方文档

shell 复制代码
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

更新镜像源

shell 复制代码
清除缓存:yum clean all
生成缓存:yum makecache
相关推荐
不死鸟.亚历山大.狼崽子5 小时前
无法将“pnpm”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次。
npm
Java 码农6 小时前
nodejs koa留言板案例开发
前端·javascript·npm·node.js
RainbowJie19 小时前
Gemini CLI 与 MCP 服务器:释放本地工具的强大潜力
java·服务器·spring boot·后端·python·单元测试·maven
中工钱袋12 小时前
java后端如何实现下载功能
spring·maven
青春不流名17 小时前
Dubbo3.3 Idea Maven编译命令
java·maven
该用户已不存在1 天前
Gradle vs. Maven,Java 构建工具该用哪个?
java·后端·maven
熊文豪1 天前
保姆级Maven安装与配置教程(Windows版)
java·windows·maven·maven安装教程·maven配置教程·maven安装与配置教程
hhzz2 天前
Maven项目中settings.xml终极优化指南
java·jdk·maven
做一位快乐的码农2 天前
房屋装修设计管理系统的设计与实现/房屋装修管理系统
java·struts·spring·eclipse·tomcat·maven
孟婆来包棒棒糖~2 天前
Maven快速入门
java·spring boot·spring·maven·intellij-idea