Skip to content

Commit

Permalink
Merge pull request #1 from chenx6/master
Browse files Browse the repository at this point in the history
Update Debian and Ubuntu's help doc
  • Loading branch information
sihuan authored Jan 13, 2024
2 parents f259d91 + 60cb387 commit c17cb27
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 25 deletions.
31 changes: 31 additions & 0 deletions site/help/debian.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
sidebarShare: true
prev: false
next: false
---

# [Debian](/debian/) 镜像

## 介绍

[Debian](https://www.debian.org/) 是一个由社区支持的 Linux 发行版。

## 使用指南

首先,通过下面命令备份原本的配置。

``` sh
sudo cp -a /etc/apt/sources.list /etc/apt/sources.list.bak
```

其次,通过下面的命令将软件源换成本镜像站。

``` sh
sudo sed -i 's/deb.debian.org/mirrors.sdust.edu.cn/g' /etc/apt/sources.list
```

最后,通过下面命令刷新缓存。

``` sh
sudo apt-get update
```
37 changes: 12 additions & 25 deletions site/help/ubuntu.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,44 +4,31 @@ prev: false
next: false
---

# [Ubuntu](/ubuntu/) Mirror
# [Ubuntu](/ubuntu/) 镜像

## Introduction
## 介绍

[Ubuntu](https://ubuntu.com/) is a popular and user-friendly Linux distribution based on Debian.
[Ubuntu](https://ubuntu.com/) 是一个基于 Debian 的 Linux 发行版。

## Backup Existing Configuration
## 使用指南

首先,通过下面命令备份原本的配置。

``` sh
sudo mv /etc/apt/sources.list /etc/apt/sources.list.backup
sudo cp -a /etc/apt/sources.list /etc/apt/sources.list.bak
```

## Edit Configuration

For Ubuntu 18.04 LTS, write the following lines to `/etc/apt/sources.list`:
其次,通过下面的命令将软件源换成本镜像站。

```
deb http://mirrors.sdust.edu.cn/ubuntu/ bionic main restricted universe multiverse
# deb-src http://mirrors.sdust.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.sdust.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
# deb-src http://mirrors.sdust.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.sdust.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src http://mirrors.sdust.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb http://mirrors.sdust.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
# deb-src http://mirrors.sdust.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
# pre-release
# deb http://mirrors.sdust.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
# deb-src http://mirrors.sdust.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
``` sh
sudo sed -i "s@http://.*archive.ubuntu.com@https://mirrors.sdust.edu.cn@g" /etc/apt/sources.list
```

::: tip
If you're using other releases, go to [Releases](https://wiki.ubuntu.com/Releases) to find the corresponding codename, and replace `bionic` in the above content.

By convention, the codename used in `sources.list` is the first word of the release's codename. For example, the code name of Ubuntu 19.04 is "Disco Dingo", so you should replace `bionic` with `disco`.
因为镜像站与上游同步有延迟,可能会导致系统不能及时检查、安装上最新的安全更新,所以不建议替换 security 源。如果需要更换的话,请通过执行下面命令更换 `sudo sed -i "s@http://.*security.ubuntu.com@https://mirrors.sdust.edu.cn@g" /etc/apt/sources.list`
:::

## Refresh Repository Indexes
最后,通过下面命令刷新缓存。

``` sh
sudo apt-get update
Expand Down

0 comments on commit c17cb27

Please sign in to comment.