refactor: update wiki.md
This commit is contained in:
parent
845b210037
commit
7cd17ca8cb
@ -6,9 +6,15 @@ icon: simple-icons:wikibooks
|
||||
---
|
||||
|
||||
:::info 关于CQMU Mirror Wiki
|
||||
重庆医科大学开源软件镜像站Wiki文档旨在帮助同学们更快了解镜像源的相关信息和配置步骤
|
||||
1. 重庆医科大学开源软件镜像站Wiki文档旨在帮助同学们更快了解镜像源的相关信息和配置步骤
|
||||
2. 本文档基于[CERNET文档](https://help.mirrors.cernet.edu.cn/)修改而来,为了保障服务可用性,后端默认指向`https://mirrors.cernet.edu.cn`,重医校园网范围内默认为`https://mirrors.cqmu.edu.cn`
|
||||
3. 若有其他问题,请通过[邮箱](mailto:losmosga@foxmail.com)联系我们
|
||||
:::
|
||||
|
||||
:::details 已镜像的源
|
||||
|
||||
|
||||
|
||||
:::tip
|
||||
即将上线
|
||||
:::
|
||||
@ -16,9 +22,7 @@ icon: simple-icons:wikibooks
|
||||
[//]: # (TODO: 待完善)
|
||||
|
||||
## :[devicon:anaconda]: Anaconda 软件仓库
|
||||
:::tip
|
||||
即将上线
|
||||
:::
|
||||
|
||||
Anaconda 是一个用于科学计算的 Python 发行版,支持 Linux, Mac, Windows, 包含了众多流行的科学计算、数据分析的 Python 包。
|
||||
|
||||
Anaconda本身可到[清华大学镜像站](https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/)下载,但是其软件源默认为国外的源,下载速度较慢,因此我们提供了Anaconda的镜像源。
|
||||
@ -27,33 +31,35 @@ Anaconda本身可到[清华大学镜像站](https://mirrors.tuna.tsinghua.edu.cn
|
||||
|
||||
镜像站提供了 Anaconda 仓库与第三方源(conda-forge、msys2、pytorch 等,各镜像站镜像的第三方源并不相同,可以参考下方「第三方镜像源」一节)的镜像,各系统都可以通过修改用户目录下的 .condarc 文件来使用镜像站。
|
||||
|
||||
不同系统下的.condarc目录如下
|
||||
:::details 不同系统下的.condarc目录如下
|
||||
|
||||
[//]: # (:::details 不同系统下的.condarc目录如下)
|
||||
:[logos:microsoft-windows-icon]: C:\Users\<YourUserName>\.condarc
|
||||
|
||||
[//]: # (:[devicon:linux]: ${HOME}/.condarc)
|
||||
:[devicon:linux]: ${HOME}/.condarc
|
||||
|
||||
[//]: # ()
|
||||
[//]: # (:[wpf:macos]: ${HOME}/.condarc)
|
||||
:[wpf:macos]: ${HOME}/.condarc
|
||||
|
||||
[//]: # ()
|
||||
[//]: # (:[logos:microsoft-windows-icon]: C:\Users\<YourUserName>\.condarc)
|
||||
|
||||
[//]: # (:::)
|
||||
|
||||
:::tabs
|
||||
|
||||
@tab :[logos:microsoft-windows-icon]: C:\Users\<YourUserName>\.condarc
|
||||
|
||||
@tab :[wpf:macos]: ${HOME}/.condarc
|
||||
|
||||
@tab :[devicon:linux]: ${HOME}/.condarc
|
||||
|
||||
:::
|
||||
|
||||
[//]: # (:::tabs)
|
||||
|
||||
[//]: # ()
|
||||
[//]: # (@tab :[logos:microsoft-windows-icon]: C:\Users\<YourUserName>\.condarc)
|
||||
|
||||
[//]: # ()
|
||||
[//]: # (@tab :[wpf:macos]: ${HOME}/.condarc)
|
||||
|
||||
[//]: # ()
|
||||
[//]: # (@tab :[devicon:linux]: ${HOME}/.condarc)
|
||||
|
||||
[//]: # ()
|
||||
[//]: # (:::)
|
||||
|
||||
|
||||
:::tip 注意
|
||||
|
||||
:::important 注意
|
||||
|
||||
Windows 用户无法直接创建名为 `.condarc` 的文件,可先执行
|
||||
```shell no
|
||||
@ -78,12 +84,12 @@ channels:
|
||||
- defaults
|
||||
show_channel_urls: true
|
||||
default_channels:
|
||||
- https://mirrors.cqmu.edu.cn/anaconda/pkgs/main
|
||||
- https://mirrors.cqmu.edu.cn/anaconda/pkgs/r
|
||||
- https://mirrors.cqmu.edu.cn/anaconda/pkgs/msys2
|
||||
- https://mirrors.cernet.edu.cn/anaconda/pkgs/main
|
||||
- https://mirrors.cernet.edu.cn/anaconda/pkgs/r
|
||||
- https://mirrors.cernet.edu.cn/anaconda/pkgs/msys2
|
||||
custom_channels:
|
||||
conda-forge: https://mirrors.cqmu.edu.cn/anaconda/cloud
|
||||
pytorch: https://mirrors.cqmu.edu.cn/anaconda/cloud
|
||||
conda-forge: https://mirrors.cernet.edu.cn/anaconda/cloud
|
||||
pytorch: https://mirrors.cernet.edu.cn/anaconda/cloud
|
||||
```
|
||||
|
||||
@tab 快速配置
|
||||
@ -93,12 +99,12 @@ channels:
|
||||
- defaults
|
||||
show_channel_urls: true
|
||||
default_channels:
|
||||
- https://mirrors.cqmu.edu.cn/anaconda/pkgs/main
|
||||
- https://mirrors.cqmu.edu.cn/anaconda/pkgs/r
|
||||
- https://mirrors.cqmu.edu.cn/anaconda/pkgs/msys2
|
||||
- https://mirrors.cernet.edu.cn/anaconda/pkgs/main
|
||||
- https://mirrors.cernet.edu.cn/anaconda/pkgs/r
|
||||
- https://mirrors.cernet.edu.cn/anaconda/pkgs/msys2
|
||||
custom_channels:
|
||||
conda-forge: https://mirrors.cqmu.edu.cn/anaconda/cloud
|
||||
pytorch: https://mirrors.cqmu.edu.cn/anaconda/cloud
|
||||
conda-forge: https://mirrors.cernet.edu.cn/anaconda/cloud
|
||||
pytorch: https://mirrors.cernet.edu.cn/anaconda/cloud
|
||||
EOF
|
||||
```
|
||||
|
||||
@ -117,7 +123,7 @@ EOF
|
||||
您可以遵循上述配置文件中的格式添加第三方源(推荐),或者通过以下命令添加第三方源
|
||||
|
||||
```shell
|
||||
conda config --set custom_channels.[package] https://mirrors.cqmu.edu.cn/anaconda/cloud/
|
||||
conda config --set custom_channels.[package] https://mirrors.cernet.edu.cn/anaconda/cloud/
|
||||
```
|
||||
|
||||
其中,`package`是你想安装的包名
|
||||
@ -134,42 +140,287 @@ conda config --set custom_channels.[package] https://mirrors.cqmu.edu.cn/anacond
|
||||
:::
|
||||
|
||||
## :[logos:pypi]: PYPI
|
||||
:::tip
|
||||
即将上线
|
||||
:::
|
||||
|
||||
### pip
|
||||
|
||||
pip是python默认的包管理器,配置镜像源的方式如下:
|
||||
|
||||
:::tabs
|
||||
|
||||
@tab 临时使用
|
||||
|
||||
```shell
|
||||
pip install -i https://mirrors.cernet.edu.cn/pypi/web/simple some-package
|
||||
```
|
||||
注意,simple 不能少。 pip 要求使用 https ,因此需要 https 而不是 http
|
||||
|
||||
@tab 设为默认
|
||||
|
||||
升级 pip 到最新的版本后进行配置:
|
||||
|
||||
```shell
|
||||
python -m pip install --upgrade pip
|
||||
pip config set global.index-url https://mirrors.cernet.edu.cn/pypi/web/simple
|
||||
```
|
||||
|
||||
如果您到 pip 默认源的网络连接较差,临时使用本镜像站来升级 pip:
|
||||
|
||||
```shell
|
||||
python -m pip install -i https://mirrors.cernet.edu.cn/pypi/web/simple --upgrade pip
|
||||
```
|
||||
|
||||
@tab 配置多个镜像源
|
||||
|
||||
如果您想配置多个镜像源平衡负载,可在已经替换 index-url 的情况下通过以下方式继续增加源站:
|
||||
|
||||
```shell
|
||||
pip config set global.extra-index-url "<url1> <url2>..."
|
||||
```
|
||||
请自行替换引号内的内容,源地址之间需要有空格
|
||||
|
||||
例如
|
||||
|
||||
```shell
|
||||
pip config set global.extra-index-url "https://mirrors.cernet.edu.cn/pypi/web/simple" "https://mirrors.cernet.edu.cn/pypi/web/simple"
|
||||
```
|
||||
|
||||
:::
|
||||
|
||||
### PDM
|
||||
|
||||
通过如下命令设置默认镜像:
|
||||
|
||||
```shell
|
||||
pdm config pypi.url https://mirrors.cernet.edu.cn/pypi/web/simple
|
||||
```
|
||||
|
||||
### Poetry
|
||||
|
||||
### Homebrew
|
||||
通过以下命令为单个项目设置首选镜像:
|
||||
|
||||
```shell
|
||||
poetry source add --priority=primary mirrors https://mirrors.cernet.edu.cn/pypi/web/simple/
|
||||
```
|
||||
|
||||
通过以下命令为单个项目设置补充镜像:
|
||||
|
||||
```shell
|
||||
poetry source add --priority=supplemental mirrors https://mirrors.cernet.edu.cn/pypi/web/simple/
|
||||
```
|
||||
|
||||
Poetry 尚未支持全局设置镜像。参考 [issue 1632](https://github.com/python-poetry/poetry/issues/1632)。
|
||||
|
||||
使用全局镜像的临时方案是将 Poetry 的安装器切换回 pip,如下所示。但该方式会在将来的版本中停止支持,参考 [PR 7356](https://github.com/python-poetry/poetry/pull/7356)。
|
||||
|
||||
```shell
|
||||
poetry config experimental.new-installer false
|
||||
```
|
||||
|
||||
## :[devicon:flutter]: Flutter 软件仓库
|
||||
:::tip
|
||||
即将上线
|
||||
:::
|
||||
|
||||
Flutter 是 Google 开源的 UI 工具包,帮助开发者通过一套代码库高效构建多平台精美应用,支持移动、Web、桌面和嵌入式平台。
|
||||
|
||||
### flutter_infra
|
||||
|
||||
获取最新稳定版 Flutter SDK 安装包可从镜像站下载
|
||||
|
||||
```shell
|
||||
https://mirrors.cernet.edu.cn/flutter/flutter_infra/releases/stable/
|
||||
```
|
||||
|
||||
Flutter 开发依赖于 [SDK 的升级](https://docs.flutter.cn/release/upgrade) 和 [Dart Package](https://pub-web.flutter-io.cn/) 生态, 因此,如果您的网络访问 Google 受阻,需要将您开发设备的如下两个环境变量设置指向镜像站:
|
||||
|
||||
- FLUTTER_STORAGE_BASE_URL
|
||||
- PUB_HOSTED_URL
|
||||
设定方式如下:
|
||||
|
||||
设定方式如下:
|
||||
|
||||
```shell
|
||||
export FLUTTER_STORAGE_BASE_URL="https://mirrors.cernet.edu.cn/flutter"
|
||||
```
|
||||
|
||||
若希望长期使用镜像:
|
||||
|
||||
```shell
|
||||
echo 'export FLUTTER_STORAGE_BASE_URL="https://mirrors.cernet.edu.cn/flutter"' >> ~/.bashrc
|
||||
```
|
||||
|
||||
PUB_HOSTED_URL 部分可以参考 [Dart Pub 帮助](https://help.mirrors.cernet.edu.cn/dart-pub/)
|
||||
|
||||
部分镜像站将 flutter_infra 单列为一个镜像,可以参考 [Flutter Infra 帮助](https://help.mirrors.cernet.edu.cn/flutter_infra/)。
|
||||
|
||||
### download.flutter.io
|
||||
|
||||
在编译 android 项目时,flutter 还会从 [https://storage.googleapis.com/download.flutter.io](https://storage.googleapis.com/download.flutter.io) 下载 Java 程序库,您可以在 Android 项目目录下的 build.gradle 中添加下面一行下载源,从而使用镜像源。
|
||||
|
||||
```yaml
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
maven { url 'https://mirrors.cernet.edu.cn/flutter/download.flutter.io' }
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Flutter SDK
|
||||
|
||||
Flutter SDK 的更新会从 Github 获取,如您的开发设备访问 Github 速度慢,可以参考 [Flutter SDK 镜像](https://help.mirrors.cernet.edu.cn/flutter-sdk.git/)。
|
||||
|
||||
更多 Flutter 资源和中文文档, 请访问 [Flutter 中文资源网站 (flutter.cn)](https://flutter.cn/) 和 [Dart 中文文档网站 (dart.cn)](https://dart.cn/)。
|
||||
|
||||
## :[simple-icons:epel]: EPEL 软件仓库
|
||||
:::tip
|
||||
即将上线
|
||||
:::
|
||||
|
||||
EPEL(Extra Packages for Enterprise Linux) 是由 Fedora Special Interest Group 维护的 Enterprise Linux(RHEL、CentOS)中经常用到的包。
|
||||
|
||||
下面以 Rocky Linux 9 为例讲解如何使用本镜像站的 epel 镜像。RHEL 及其他衍生发行版同样可用该方法。
|
||||
|
||||
首先从 Extras 里安装 epel-release:
|
||||
|
||||
```shell
|
||||
sudo dnf install epel-release
|
||||
```
|
||||
|
||||
用如下命令自动替换:
|
||||
|
||||
```shell
|
||||
sudo sed -e 's!^metalink=!#metalink=!g' \
|
||||
-e 's!^#baseurl=!baseurl=!g' \
|
||||
-e 's!https\?://download\.fedoraproject\.org/pub/epel!https://mirrors.cernet.edu.cn/epel!g' \
|
||||
-e 's!https\?://download\.example/pub/epel!https://mirrors.cernet.edu.cn/epel!g' \
|
||||
-i /etc/yum.repos.d/epel{,-testing}.repo
|
||||
```
|
||||
|
||||
`epel.repo` 的修改结果如下:(仅供参考,不同版本可能不同)
|
||||
|
||||
```shell
|
||||
[epel]
|
||||
name=Extra Packages for Enterprise Linux $releasever - $basearch
|
||||
# It is much more secure to use the metalink, but if you wish to use a local mirror
|
||||
# place its address here.
|
||||
baseurl=https://mirrors.cernet.edu.cn/epel/$releasever/Everything/$basearch/
|
||||
#metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-$releasever&arch=$basearch&infra=$infra&content=$contentdir
|
||||
enabled=1
|
||||
gpgcheck=1
|
||||
countme=1
|
||||
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-$releasever
|
||||
|
||||
[epel-debuginfo]
|
||||
name=Extra Packages for Enterprise Linux $releasever - $basearch - Debug
|
||||
# It is much more secure to use the metalink, but if you wish to use a local mirror
|
||||
# place its address here.
|
||||
baseurl=https://mirrors.cernet.edu.cn/epel/$releasever/Everything/$basearch/debug/
|
||||
#metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-$releasever&arch=$basearch&infra=$infra&content=$contentdir
|
||||
enabled=0
|
||||
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-$releasever
|
||||
gpgcheck=1
|
||||
|
||||
[epel-source]
|
||||
name=Extra Packages for Enterprise Linux $releasever - $basearch - Source
|
||||
# It is much more secure to use the metalink, but if you wish to use a local mirror
|
||||
# place its address here.
|
||||
baseurl=https://mirrors.cernet.edu.cn/epel/$releasever/Everything/source/tree/
|
||||
#metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-source-$releasever&arch=$basearch&infra=$infra&content=$contentdir
|
||||
enabled=0
|
||||
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-$releasever
|
||||
gpgcheck=1
|
||||
```
|
||||
|
||||
由于无法同步,镜像站不包含 EPEL Cisco OpenH264 仓库(`epel-cisco-openh264.repo`),如果不需要可手动将其改为 `enabled=0`
|
||||
|
||||
运行 `dnf update` 测试一下吧。
|
||||
|
||||
## :[logos:ubuntu]: Ubuntu 软件仓库
|
||||
:::tip
|
||||
即将上线
|
||||
:::
|
||||
|
||||
|
||||
参考 [CERNET文档](https://help.mirrors.cernet.edu.cn/ubuntu/) 即可
|
||||
|
||||
## :[devicon:qt]: Qt 软件仓库
|
||||
:::tip
|
||||
即将上线
|
||||
:::
|
||||
|
||||
通过以下链接下载在线安装器
|
||||
|
||||
```shell
|
||||
https://mirrors.cernet.edu.cn/qt/official_releases/online_installers/
|
||||
```
|
||||
|
||||
```shell
|
||||
# linux
|
||||
installer --mirror https://mirrors.cernet.edu.cn/qt
|
||||
# windows
|
||||
installer.exe --mirror https://mirrors.cernet.edu.cn/qt
|
||||
```
|
||||
|
||||
## :[devicon:ros]: ROS2 软件仓库
|
||||
|
||||
参考 [CERNET文档](https://help.mirrors.cernet.edu.cn/ros2/) 即可
|
||||
|
||||
:::tip
|
||||
即将上线
|
||||
导入`ros.key`有问题可以参考[magic](/csdiy/tools-must/magic/clash-core/windows/)
|
||||
:::
|
||||
|
||||
## :[vscode-icons:file-type-tex]: CTAN 镜像
|
||||
:::tip
|
||||
即将上线
|
||||
|
||||
CTAN (The Comprehensive TeX Archive Network) 是所有 TeX 排版系统相关材料的汇集地,收录了编译引擎、宏包及字体等的源代码与说明文档。目前,绝大多数 LaTeX 宏包会被上传至 CTAN 核心站点,随后同步到遍布全球的各个镜像。
|
||||
|
||||
本文提供了 TeX Live 和 MiKTeX 两大主要发行版的镜像配置方法。
|
||||
|
||||
### TeX Live
|
||||
|
||||
TeX Live 是目前使用最为广泛的 TeX 发行版,支持 Windows、Linux 和 macOS。其中,在 macOS 上发行的版本称为 MacTeX。
|
||||
|
||||
安装方法
|
||||
TeX Live 发行版的常见安装方法可以参考[此文档](https://mirrors.cernet.edu.cn/CTAN/info/install-latex-guide-zh-cn/install-latex-guide-zh-cn.pdf)。
|
||||
|
||||
除每年更新的完整版 ISO 镜像以外,CTAN 镜像中也包含在线安装器。这种方法可以使安装的所有宏包均为最新版本,但受网络连接状况影响较大。操作方法为(很可能需要管理员权限):
|
||||
|
||||
:::steps
|
||||
|
||||
1. 下载 install-tl.zip 并解压缩
|
||||
|
||||
[https://mirrors.cernet.edu.cn/CTAN/systems/texlive/tlnet/install-tl.zip](https://mirrors.cernet.edu.cn/CTAN/systems/texlive/tlnet/install-tl.zip)
|
||||
|
||||
2. Windows 下双击运行其中的 `install-tl.bat`。如果有图形化界面,可以在进入安装器前的右下角按钮指定使用镜像源。
|
||||
|
||||
Linux 下使用如下命令:
|
||||
|
||||
```shell
|
||||
perl install-tl --repository https://mirrors.cernet.edu.cn/CTAN/systems/texlive/tlnet
|
||||
```
|
||||
|
||||
切换镜像
|
||||
TeX Live 使用的 CTAN 镜像源可以从内置的包管理器 `tlmgr` 更改(很可能需要管理员权限)。
|
||||
|
||||
在命令行中执行
|
||||
|
||||
```shell
|
||||
tlmgr option repository https://mirrors.cernet.edu.cn/CTAN/systems/texlive/tlnet
|
||||
```
|
||||
|
||||
即可永久更改镜像源。
|
||||
|
||||
如果只需要临时切换,可以用如下命令:
|
||||
|
||||
```shell
|
||||
tlmgr update --all --repository https://mirrors.cernet.edu.cn/CTAN/systems/texlive/tlnet
|
||||
```
|
||||
|
||||
其中的 `update --all` 指令可根据需要修改。
|
||||
|
||||
:::
|
||||
|
||||
### MiKTeX
|
||||
|
||||
MiKTeX 发行版的特点在于仅安装用户需要的宏包,节省了磁盘空间占用,但在部分实现细节上与 TeX Live 有所出入。该发行版支持 Windows、Linux 和 macOS。
|
||||
|
||||
安装
|
||||
MiKTeX 仅提供 Windows 和 macOS 的独立安装包,前往[TeX 排版系统下载页](https://mirrors.cernet.edu.cn/app/TeX%E6%8E%92%E7%89%88%E7%B3%BB%E7%BB%9F)即可。在 Linux 下的安装请参考[官方文档](https://miktex.org/howto/install-miktex-unx)。
|
||||
|
||||
### pkgsrc
|
||||
|
||||
参考[文档](https://help.mirrors.cernet.edu.cn/pkgsrc/)
|
||||
|
||||
MASTER_SITE_TEX_CTAN= https://mirrors.cernet.edu.cn/CTAN/
|
Loading…
x
Reference in New Issue
Block a user