Skip to content

Commit

Permalink
Update ubuntu.md (#169)
Browse files Browse the repository at this point in the history
Co-authored-by: LightQuantum <[email protected]>
  • Loading branch information
wohenbushuang and PhotonQuantum committed Aug 6, 2024
1 parent 9fa1ab2 commit 77979d8
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions content/post/mirror-help/ubuntu.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ SJTUG镜像源可以加速软件包的安装。

使用方式:

使用`sudo nano /etc/apt/sources.list`打开镜像源列表文件。将类似于`http://cn.archive.ubuntu.com/ubuntu``http://cn.archive.ubuntu.com/ubuntu`的地址改成`https://mirror.sjtu.edu.cn/ubuntu`,之后按`Ctrl-O 回车`保存,按`Ctrl-X`退出。最后执行`sudo apt update`即可。
使用`sudo nano /etc/apt/sources.list`打开镜像源列表文件。将类似于`http://archive.ubuntu.com/ubuntu``http://cn.archive.ubuntu.com/ubuntu`的地址改成`https://mirror.sjtu.edu.cn/ubuntu`,之后按`Ctrl-O 回车`保存,按`Ctrl-X`退出。最后执行`sudo apt update`即可。

镜像站一天同步一次 Ubuntu 镜像。为了取得最新的安全更新,我们不建议您将 `security.ubuntu.com` 换成镜像源。

您也可使用`sudo sed -i 's/http:\/\/cn.archive.ubuntu.com/https:\/\/mirror.sjtu.edu.cn/g' /etc/apt/sources.list`指令直接批量修改。
您也可使用`sudo sed -i 's/http:\/\/archive.ubuntu.com/https:\/\/mirror.sjtu.edu.cn/g' /etc/apt/sources.list``sudo sed -i 's/http:\/\/cn.archive.ubuntu.com/https:\/\/mirror.sjtu.edu.cn/g' /etc/apt/sources.list`指令直接批量修改。

以下为修改后的镜像源列表文件的示例。可使用`gedit`等文本编辑器修改`/etc/apt/sources.list`。修改后使用`sudo apt update`更新软件源。

Expand Down Expand Up @@ -67,4 +67,20 @@ deb https://mirror.sjtu.edu.cn/ubuntu/ jammy-security main restricted universe m
# deb-src https://mirror.sjtu.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse
```

Ubuntu 24.04

```
deb https://mirror.sjtu.edu.cn/ubuntu/ noble main restricted universe multiverse
# deb-src https://mirror.sjtu.edu.cn/ubuntu/ noble main restricted universe multiverse
deb https://mirror.sjtu.edu.cn/ubuntu/ noble-updates main restricted universe multiverse
# deb-src https://mirror.sjtu.edu.cn/ubuntu/ noble-updates main restricted universe multiverse
deb https://mirror.sjtu.edu.cn/ubuntu/ noble-backports main restricted universe multiverse
# deb-src https://mirror.sjtu.edu.cn/ubuntu/ noble-backports main restricted universe multiverse
deb https://mirror.sjtu.edu.cn/ubuntu/ noble-security main restricted universe multiverse
# deb-src https://mirror.sjtu.edu.cn/ubuntu/ noble-security main restricted universe multiverse
# deb https://mirror.sjtu.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse
# deb-src https://mirror.sjtu.edu.cn/ubuntu/ jammy-proposed main restricted universe multiverse
```

其中`deb-src`为源码镜像,默认注释以提高速度。可将原镜像列表备份后替换为上述内容。

0 comments on commit 77979d8

Please sign in to comment.