From 60cb387924b2ac06a90b907f78adf14268619dfe Mon Sep 17 00:00:00 2001 From: chen_null Date: Sat, 13 Jan 2024 15:30:11 +0800 Subject: [PATCH] Update Debian and Ubuntu's help doc --- site/help/debian.md | 31 +++++++++++++++++++++++++++++++ site/help/ubuntu.md | 37 ++++++++++++------------------------- 2 files changed, 43 insertions(+), 25 deletions(-) create mode 100644 site/help/debian.md diff --git a/site/help/debian.md b/site/help/debian.md new file mode 100644 index 00000000..fc5fe698 --- /dev/null +++ b/site/help/debian.md @@ -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 +``` diff --git a/site/help/ubuntu.md b/site/help/ubuntu.md index 0a808a68..379d6a4c 100644 --- a/site/help/ubuntu.md +++ b/site/help/ubuntu.md @@ -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