mirror of
https://github.com/Kxsso/jcutmirror.git
synced 2026-03-27 15:27:02 +08:00
71 lines
2.5 KiB
Plaintext
71 lines
2.5 KiB
Plaintext
---
|
|
mirrorId: ubuntu
|
|
---
|
|
|
|
import ConfigGenerator from '../../src/components/config-generator'
|
|
|
|
export const ubuntuVersionMap = {
|
|
"23.04": "lunar",
|
|
"22.10": "kinetic",
|
|
"22.04 LTS": "jammy",
|
|
"20.04 LTS": "focal",
|
|
"18.04 LTS": "bionic",
|
|
"16.04 LTS": "xenial",
|
|
"14.04 LTS": "trusty",
|
|
}
|
|
|
|
export const GenUbuntuConfig = (version) => {
|
|
var ubuntuName = ubuntuVersionMap[version]
|
|
return `# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
|
|
deb https://mirrors.jcut.edu.cn/ubuntu/ ${ubuntuName} main restricted universe multiverse
|
|
# deb-src https://mirrors.jcut.edu.cn/ubuntu/ ${ubuntuName} main restricted universe multiverse
|
|
deb https://mirrors.jcut.edu.cn/ubuntu/ ${ubuntuName}-updates main restricted universe multiverse
|
|
# deb-src https://mirrors.jcut.edu.cn/ubuntu/ ${ubuntuName}-updates main restricted universe multiverse
|
|
deb https://mirrors.jcut.edu.cn/ubuntu/ ${ubuntuName}-backports main restricted universe multiverse
|
|
# deb-src https://mirrors.jcut.edu.cn/ubuntu/ ${ubuntuName}-backports main restricted universe multiverse
|
|
deb https://mirrors.jcut.edu.cn/ubuntu/ ${ubuntuName}-security main restricted universe multiverse
|
|
# deb-src https://mirrors.jcut.edu.cn/ubuntu/ ${ubuntuName}-security main restricted universe multiverse\n
|
|
# 预发布软件源,不建议启用
|
|
# deb https://mirrors.jcut.edu.cn/ubuntu/ ${ubuntuName}-proposed main restricted universe multiverse
|
|
# deb-src https://mirrors.jcut.edu.cn/ubuntu/ ${ubuntuName}-proposed main restricted universe multiverse`
|
|
}
|
|
|
|
export const defaultVersion = Object.keys(ubuntuVersionMap).find(x => x.indexOf("LTS") > 0);
|
|
|
|
## Ubuntu 源使用帮助
|
|
|
|
### 地址
|
|
|
|
[https://mirrors.jcut.edu.cn/ubuntu/](https://mirrors.jcut.edu.cn/ubuntu/)
|
|
|
|
### 说明
|
|
|
|
*Ubuntu* 软件源
|
|
|
|
### 收录架构
|
|
|
|
amd64(X86_64), i386
|
|
|
|
### 收录版本
|
|
|
|
所有 *Ubuntu* 当前支持的版本,包括开发版,具体版本见 [https://wiki.ubuntu.com/Releases](https://wiki.ubuntu.com/Releases)
|
|
|
|
---
|
|
|
|
### 使用方法
|
|
|
|
#### 方法一
|
|
|
|
一般情况下,将 `/etc/apt/sources.list` 文件中 *Ubuntu* 默认的源地址 `http://archive.ubuntu.com/` 替换为 `http://mirrors.jcut.edu.cn/` 即可。
|
|
|
|
可以使用如下命令:
|
|
|
|
```shell
|
|
sudo sed -i 's@//.*archive.ubuntu.com@//mirrors.jcut.edu.cn@g' /etc/apt/sources.list
|
|
```
|
|
|
|
#### 方法二
|
|
|
|
直接编辑 `/etc/apt/sources.list` 文件(需要使用 `sudo`)。
|
|
<ConfigGenerator promptString="请选择您的 Ubuntu 版本:" versionList={Object.keys(ubuntuVersionMap)} defaultVersion={defaultVersion} configGen={GenUbuntuConfig} language="bash" />
|