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
相关推荐
敲代码的嘎仔27 分钟前
JavaWeb零基础学习Day4——Maven
java·开发语言·学习·算法·maven·javaweb·学习方法
陈小桔11 小时前
idea中重新加载所有maven项目失败,但maven compile成功
java·maven
自由会客室19 小时前
Ubuntu 24.04 上安装 Sonatype Nexus Repository(Maven 私服)
架构·maven
Nie_Xun21 小时前
conda常用命令&pip、venv
conda·pip
万粉变现经纪人1 天前
如何解决 pip install -r requirements.txt 子目录可编辑安装缺少 pyproject.toml 问题
开发语言·python·scrapy·beautifulsoup·scikit-learn·matplotlib·pip
哞哞不熬夜1 天前
JavaEE--SpringIoC
java·开发语言·spring boot·spring·java-ee·maven
TT哇1 天前
【Maven】Maven设置国内源
java·maven
万粉变现经纪人1 天前
如何解决 pip install -r requirements.txt 私有索引未设为 trusted-host 导致拒绝 问题
开发语言·python·scrapy·flask·beautifulsoup·pandas·pip
编啊编程啊程1 天前
【011】宠物共享平台
spring boot·log4j·maven·dubbo·宠物
duandashuaige2 天前
解决用electron打包Vue工程(Vite)报错electron : Failed to load URL : xxx... with error : ERR _CONNECTION_REFUSED
javascript·typescript·electron·npm·vue·html