Skip to content

Commit

Permalink
feat: add mirror
Browse files Browse the repository at this point in the history
  • Loading branch information
leavelet committed Aug 30, 2024
1 parent 47aaec3 commit bab6637
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 1 deletion.
6 changes: 5 additions & 1 deletion getting-started/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ result = requests.post(url, params=payload, headers=headers)
print(result.text)
```

将程序保存为`login.py`,运行程序,根据提示输入用户名和密码,就可以登陆网关了。程序会返回网关的登陆结果。** 注意,密码不会显示在终端上,这是为了保护密码的安全,直接输入即可。**
将程序保存为`login.py`,运行程序,根据提示输入用户名和密码,就可以登陆网关了。程序会返回网关的登陆结果。注意,密码不会显示在终端上,这是为了保护密码的安全,直接输入即可。


```bash
python3 login.py
Expand All @@ -159,6 +160,9 @@ python3 login.py
sudo apt install python3 # Ubuntu, Debian
sudo dnf install python3 # Fedora, CentOS, Rocky Linux
```

未联网前可访问北京大学镜像站 mirrors.pku.edu.cn 获取软件源,请参考[网络:北京大学镜像站](/getting-started/lcpu-mirror)

# 总结

本文介绍了如何创建和连接云主机。创建云主机时,需要选择规格、镜像、硬盘类型和大小、网络、安全组、名称和密钥等信息。连接云主机时,需要使用 SSH 客户端,输入云主机的内网 IP 地址和用户名,就可以连接到云主机了。希望大家能够顺利创建和连接云主机,体验云平台的便利和强大功能。
Expand Down
63 changes: 63 additions & 0 deletions getting-started/lcpu-mirror.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
title: 校内镜像站使用
---

# 校内镜像站使用

北京大学镜像站 mirrors.pku.edu.cn 是设置在校内的镜像站,速度较快,同时不需要登陆网关即可使用,推荐大家使用北大镜像站,一下是常见系统的使用方法。

## Rocky Linux 9

```bash
sed -e 's|^mirrorlist=|#mirrorlist=|g' \
-e 's|^#baseurl=http://dl.rockylinux.org/$contentdir|baseurl=https://mirrors.pku.edu.cn/rocky|g' \
-i.bak \
/etc/yum.repos.d/rocky-extras.repo \
/etc/yum.repos.d/rocky.repo
```

## Rocky Linux 8

```bash
sed -e 's|^mirrorlist=|#mirrorlist=|g' \
-e 's|^#baseurl=http://dl.rockylinux.org/$contentdir|baseurl=https://mirrors.pku.edu.cn/rocky|g' \
-i.bak \
/etc/yum.repos.d/Rocky-AppStream.repo \
/etc/yum.repos.d/Rocky-BaseOS.repo \
/etc/yum.repos.d/Rocky-Extras.repo \
/etc/yum.repos.d/Rocky-PowerTools.repo
```

## Ubuntu 24.04

```bash
sudo sed -i 's@//.*archive.ubuntu.com@//mirrors.pku.edu.cn@g' /etc/apt/sources.list.d/ubuntu.sources
```

## Ubuntu 20.04 & 22.04

```bash
sudo sed -i 's@//.*archive.ubuntu.com@//mirrors.pku.edu.cn@g' /etc/apt/sources.list
```

## Debian 12

```bash
sudo sed -i 's/deb.debian.org/mirrors.pku.edu.cn/g' /etc/apt/mirrors/debian.list
sudo sed -i 's/deb.debian.org/mirrors.pku.edu.cn/g' /etc/apt/mirrors/debian-security.list
```

## Debian 11

```bash
sudo sed -i 's@http://deb.debian.org@https://mirrors.pku.edu.cn@g' /etc/apt/sources.list
sudo sed -i 's@http://security.debian.org@https://mirrors.pku.edu.cn@g' /etc/apt/sources.list
```

## Arch Linux

编辑文件/etc/pacman.d/mirrorlist,在开头插入

```
Server = https://mirrors.pku.edu.cn/archlinux/$repo/os/$arch
``

0 comments on commit bab6637

Please sign in to comment.