Skip to content

Commit

Permalink
Doc: add CentOS and Anaconda
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc9982 authored and billchenchina committed Jul 26, 2023
1 parent e74082a commit b6e7dac
Show file tree
Hide file tree
Showing 6 changed files with 109 additions and 4 deletions.
7 changes: 7 additions & 0 deletions src/components/docPage/doc/js/anaconda.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React from "react";
import DocTemplate from "../docTemplate.js";
import doc from "../markdown/anaconda.md";

export default function() {
return <DocTemplate doc={doc} />;
}
7 changes: 7 additions & 0 deletions src/components/docPage/doc/js/centos.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React from "react";
import DocTemplate from "../docTemplate.js";
import doc from "../markdown/centos.md";

export default function() {
return <DocTemplate doc={doc} />;
}
40 changes: 40 additions & 0 deletions src/components/docPage/doc/markdown/anaconda.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Anaconda 镜像使用帮助

Anaconda 是一个用于科学计算的 Python 发行版,支持 Linux, Mac, Windows, 包含了众多流行的科学计算、数据分析的 Python 包。

Anaconda 安装包可以到 https://mirrors.hit.edu.cn/anaconda/archive/ 下载。

TUNA 还提供了 Anaconda 仓库与第三方源(conda-forge、msys2、pytorch等,[查看完整列表](https://mirrors.hit.edu.cn/anaconda/cloud/),更多第三方源可以前往[校园网联合镜像站](https://mirrors.cernet.edu.cn/list/anaconda)查看)的镜像,各系统都可以通过修改用户目录下的 `.condarc` 文件来使用 TUNA 镜像源。Windows 用户无法直接创建名为 `.condarc` 的文件,可先执行 `conda config --set show_channel_urls yes` 生成该文件之后再修改。

注:由于更新过快难以同步,我们不同步 `pytorch-nightly`, `pytorch-nightly-cpu`, `ignite-nightly` 这三个包。

```yaml
channels:
- defaults
show_channel_urls: true
default_channels:
- https://mirrors.hit.edu.cn/anaconda/pkgs/main
- https://mirrors.hit.edu.cn/anaconda/pkgs/r
- https://mirrors.hit.edu.cn/anaconda/pkgs/msys2
custom_channels:
conda-forge: https://mirrors.hit.edu.cn/anaconda/cloud
msys2: https://mirrors.hit.edu.cn/anaconda/cloud
bioconda: https://mirrors.hit.edu.cn/anaconda/cloud
menpo: https://mirrors.hit.edu.cn/anaconda/cloud
pytorch: https://mirrors.hit.edu.cn/anaconda/cloud
pytorch-lts: https://mirrors.hit.edu.cn/anaconda/cloud
simpleitk: https://mirrors.hit.edu.cn/anaconda/cloud
```

即可添加 Anaconda Python 免费仓库。

运行 `conda clean -i` 清除索引缓存,保证用的是镜像站提供的索引。

运行 `conda create -n myenv numpy` 测试一下吧。

## Miniconda 镜像使用帮助

Miniconda 是一个 Anaconda 的轻量级替代,默认只包含了 python 和 conda,但是可以通过 pip 和 conda 来安装所需要的包。

Miniconda 安装包可以到 <https://mirrors.hit.edu.cn/anaconda/miniconda/> 下载。

43 changes: 43 additions & 0 deletions src/components/docPage/doc/markdown/centos.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# CentOS 镜像使用帮助

## 0. 备份软件源配置文件

CentOS 的软件源配置文件位于 `/etc/yum.repos.d/`。为了保证安全,请将其备份后再进行以下操作。

如:

```shell
sudo cp -r /etc/yum.repos.d/ /etc/yum.repos.d.bak/
```

## 1. 编辑配置文件

将上文中的配置文件替换为以下内容即可使用哈尔滨工业大学提供的镜像源服务,请根据你的 CentOS 版本进行操作。

+ CentOS 7

```shell
sudo sed -e 's|^mirrorlist=|#mirrorlist=|g' \
-e 's|^#baseurl=http://mirror.centos.org/centos|baseurl=https://mirrors.hit.edu.cn/centos|g' \
-i.bak \
/etc/yum.repos.d/CentOS-*.repo
```

+ CentOS 8

```shell
sudo sed -e 's|^mirrorlist=|#mirrorlist=|g' \
-e 's|^#baseurl=http://mirror.centos.org/$contentdir|baseurl=https://mirrors.hit.edu.cn/centos|g' \
-i.bak \
/etc/yum.repos.d/CentOS-*.repo
```

注意其中的 `*` 通配符,如果只需要替换一些文件中的源,请自行增删。

注意,如果需要启用其中一些 repo,需要将其中的 `enabled=0` 改为 `enabled=1`

最后,更新软件包缓存

```shell
sudo yum makecache
```
8 changes: 4 additions & 4 deletions src/components/docPage/doc/markdown/debian.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup

+ buster

```
```shell
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
# 目前还未提供debian-security,请注意添加
deb https://mirrors.hit.edu.cn/debian/ buster main contrib non-free
Expand All @@ -29,7 +29,7 @@ sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup

+ stretch

```
```shell
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
# 目前还未提供debian-security,请注意添加
deb https://mirrors.hit.edu.cn/debian/ stretch main contrib non-free
Expand All @@ -42,7 +42,7 @@ sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup

+ jessie

```
```shell
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
# 目前还未提供debian-security,请注意添加
deb https://mirrors.hit.edu.cn/debian/ stretch main contrib non-free
Expand All @@ -55,7 +55,7 @@ sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup

+ bullseye

```
```shell
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
# 目前还未提供debian-security,请注意添加
deb https://mirrors.hit.edu.cn/debian/ bullseye main contrib non-free
Expand Down
8 changes: 8 additions & 0 deletions src/components/docPage/menu.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
"title": "欢迎来到帮助文档",
"name": "docHome"
},
{
"title": "Anaconda",
"name": "anaconda"
},
{
"title": "BlackArch",
"name": "blackarch"
Expand All @@ -12,6 +16,10 @@
"title": "CTAN",
"name": "CTAN"
},
{
"title": "CentOS",
"name": "centos"
},
{
"title": "Debian",
"name": "debian"
Expand Down

0 comments on commit b6e7dac

Please sign in to comment.