Skip to content

Commit

Permalink
Update ubuntu.md, ubuntu-ports.md
Browse files Browse the repository at this point in the history
add support for new deb822 format and fix typo
Ref: sjtug/mirror-requests#378 https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/
  • Loading branch information
definfo committed Dec 19, 2024
1 parent eab8cfb commit e1b0098
Show file tree
Hide file tree
Showing 2 changed files with 105 additions and 3 deletions.
58 changes: 58 additions & 0 deletions content/post/mirror-help/ubuntu-ports.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ author = "wdwang"

可使用`gedit`等文本编辑器修改`/etc/apt/sources.list`。修改后使用`sudo apt update`更新软件源。

从 Ubuntu 24.04 起,Ubuntu 的软件源配置文件变更为 DEB822 格式,在此格式下使用镜像源时,须注意替换`/etc/apt/sources.list`对应路径为`/etc/apt/sources.list.d/ubuntu.sources`

Ubuntu 18.04

```
Expand Down Expand Up @@ -56,4 +58,60 @@ deb https://mirror.sjtu.edu.cn/ubuntu-ports/ jammy-security main restricted univ
# deb-src https://mirror.sjtu.edu.cn/ubuntu-ports/ jammy-proposed main restricted universe multiverse
```

Ubuntu 24.04 (DEB822 格式) `/etc/apt/sources.list.d/ubuntu.sources`

```
Types: deb
URIs: https://mirror.sjtu.edu.cn/ubuntu/
Suites: noble noble-updates noble-backports
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
# Types: deb-src
# URIs: https://mirror.sjtu.edu.cn/ubuntu/
# Suites: noble noble-updates noble-backports
# Components: main restricted universe multiverse
# Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
Types: deb
URIs: https://mirror.sjtu.edu.cn/ubuntu/
Suites: noble-security
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
# Types: deb-src
# URIs: https://mirror.sjtu.edu.cn/ubuntu/
# Suites: noble-security
# Components: main restricted universe multiverse
# Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
# Types: deb
# URIs: https://mirror.sjtu.edu.cn/ubuntu/
# Suites: noble-proposed
# Components: main restricted universe multiverse
# Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
# Types: deb-src
# URIs: https://mirror.sjtu.edu.cn/ubuntu/
# Suites: noble-proposed
# Components: main restricted universe multiverse
# Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
```

Ubuntu 24.04 (旧格式,不推荐使用) `/etc/apt/sources.list`

```
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/ noble-proposed main restricted universe multiverse
# deb-src https://mirror.sjtu.edu.cn/ubuntu/ noble-proposed main restricted universe multiverse
```

其中`deb-src`为源码镜像,默认注释以提高速度。可将原镜像列表备份后替换为上述内容。
50 changes: 47 additions & 3 deletions content/post/mirror-help/ubuntu.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Ubuntu是一个基于Debian的Linux发行版,包含了常用的大量软件包

SJTUG镜像源可以加速软件包的安装。

本镜像仅包含 32/64 位 x86 架构处理器的软件包,在 ARM(arm64, armhf)、PowerPC(ppc64el)、RISC-V(riscv64) 和 S390x 等架构的设备上(对应官方源为 ports.ubuntu.com)请使用 ubuntu-ports 镜像。

使用方式:

使用`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`即可。
Expand All @@ -19,6 +21,8 @@ SJTUG镜像源可以加速软件包的安装。

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

从 Ubuntu 24.04 起,Ubuntu 的软件源配置文件变更为 DEB822 格式,在此格式下使用镜像源时,须注意替换`/etc/apt/sources.list`对应路径为`/etc/apt/sources.list.d/ubuntu.sources`

Ubuntu 18.04

```
Expand Down Expand Up @@ -67,7 +71,47 @@ 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
Ubuntu 24.04 (DEB822 格式) `/etc/apt/sources.list.d/ubuntu.sources`

```
Types: deb
URIs: https://mirror.sjtu.edu.cn/ubuntu/
Suites: noble noble-updates noble-backports
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
# Types: deb-src
# URIs: https://mirror.sjtu.edu.cn/ubuntu/
# Suites: noble noble-updates noble-backports
# Components: main restricted universe multiverse
# Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
Types: deb
URIs: https://mirror.sjtu.edu.cn/ubuntu/
Suites: noble-security
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
# Types: deb-src
# URIs: https://mirror.sjtu.edu.cn/ubuntu/
# Suites: noble-security
# Components: main restricted universe multiverse
# Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
# Types: deb
# URIs: https://mirror.sjtu.edu.cn/ubuntu/
# Suites: noble-proposed
# Components: main restricted universe multiverse
# Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
# Types: deb-src
# URIs: https://mirror.sjtu.edu.cn/ubuntu/
# Suites: noble-proposed
# Components: main restricted universe multiverse
# Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
```

Ubuntu 24.04 (旧格式,不推荐使用) `/etc/apt/sources.list`

```
deb https://mirror.sjtu.edu.cn/ubuntu/ noble main restricted universe multiverse
Expand All @@ -79,8 +123,8 @@ deb https://mirror.sjtu.edu.cn/ubuntu/ noble-backports main restricted universe
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 https://mirror.sjtu.edu.cn/ubuntu/ noble-proposed main restricted universe multiverse
# deb-src https://mirror.sjtu.edu.cn/ubuntu/ noble-proposed main restricted universe multiverse
```

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

0 comments on commit e1b0098

Please sign in to comment.