mirror-help: add ubuntu-ports.md#86
Conversation
mirror-help: add ubuntu-ports.md
Co-authored-by: Alex Chi <iskyzh@gmail.com>
Co-authored-by: Alex Chi <iskyzh@gmail.com>
skyzh
left a comment
There was a problem hiding this comment.
一般在这里还需要添加用户配置方法。参考一下 debian.md?
mirror-help:update ubuntu-ports.md
skyzh
left a comment
There was a problem hiding this comment.
顺便一提,这个一键替换指令在你的机器上可以用吗?帮忙测试一下?
|
|
||
| 镜像站一天同步一次 Ubuntu 镜像。为了取得最新的安全更新,我们不建议您将 security.ubuntu.com 换成镜像源。 | ||
|
|
||
| 您也可使用sudo sed -i 's/http:\/\/cn.archive.ubuntu.com/http:\/\/mirrors.sjtug.sjtu.edu.cn/g' /etc/apt/sources.list指令直接批量修改。 |
There was a problem hiding this comment.
| 您也可使用sudo sed -i 's/http:\/\/cn.archive.ubuntu.com/http:\/\/mirrors.sjtug.sjtu.edu.cn/g' /etc/apt/sources.list指令直接批量修改。 | |
| 您也可使用 `sudo sed -i 's/http:\/\/cn.archive.ubuntu.com/http:\/\/mirrors.sjtug.sjtu.edu.cn/g' /etc/apt/sources.list` 指令直接批量修改。 |
There was a problem hiding this comment.
测试了,是可以的,不是 arm 环境是 x86 环境。我觉得硬替换应该没问题吧
There was a problem hiding this comment.
印象里 ubuntu-ports 的默认源是不带 cn 的,还是要之后确认一下。这个 PR 暂且搁置。
There was a problem hiding this comment.
我也没有类似的设备 暂且搁置吧
There was a problem hiding this comment.
虽然我觉得可以做一个类似于这个https://github.com/tuna/oh-my-tuna 虽然是愚人节玩笑
There was a problem hiding this comment.
印象里 ubuntu-ports 的默认源是不带 cn 的,还是要之后确认一下。这个 PR 暂且搁置。
ubuntu-ports 默认源都是类似 deb http://ports.ubuntu.com/ubuntu-ports/ focal main restricted 这种。
这个可以用docker很容易看到,如
docker run -it --rm ubuntu@sha256:26c3bd3ae441c873a210200bcbb975ffd2bbf0c0841a4584f4476c8a5b8f3d99 cat /etc/apt/sources.list
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://ports.ubuntu.com/ubuntu-ports/ focal main restricted
# deb-src http://ports.ubuntu.com/ubuntu-ports/ focal main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://ports.ubuntu.com/ubuntu-ports/ focal-updates main restricted
# deb-src http://ports.ubuntu.com/ubuntu-ports/ focal-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://ports.ubuntu.com/ubuntu-ports/ focal universe
# deb-src http://ports.ubuntu.com/ubuntu-ports/ focal universe
deb http://ports.ubuntu.com/ubuntu-ports/ focal-updates universe
# deb-src http://ports.ubuntu.com/ubuntu-ports/ focal-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://ports.ubuntu.com/ubuntu-ports/ focal multiverse
# deb-src http://ports.ubuntu.com/ubuntu-ports/ focal multiverse
deb http://ports.ubuntu.com/ubuntu-ports/ focal-updates multiverse
# deb-src http://ports.ubuntu.com/ubuntu-ports/ focal-updates multiverse
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://ports.ubuntu.com/ubuntu-ports/ focal-backports main restricted universe multiverse
# deb-src http://ports.ubuntu.com/ubuntu-ports/ focal-backports main restricted universe multiverse
## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu focal partner
# deb-src http://archive.canonical.com/ubuntu focal partner
deb http://ports.ubuntu.com/ubuntu-ports/ focal-security main restricted
# deb-src http://ports.ubuntu.com/ubuntu-ports/ focal-security main restricted
deb http://ports.ubuntu.com/ubuntu-ports/ focal-security universe
# deb-src http://ports.ubuntu.com/ubuntu-ports/ focal-security universe
deb http://ports.ubuntu.com/ubuntu-ports/ focal-security multiverse
# deb-src http://ports.ubuntu.com/ubuntu-ports/ focal-security multiverse
所以应该使用类似 sudo sed -i 's|ports.ubuntu.com|mirror.sjtu.edu.cn|g' /etc/apt/sources.list 进行一键替换。
There was a problem hiding this comment.
争取过几天去真机 例如树莓派 nVidia开发板上面跑跑看
There was a problem hiding this comment.
其实 ubuntu 源里有个cn就很奇怪,镜像里都是没有的,所以这应该是本地初始化时加的,脚本里直接绝对匹配cn这不合理。
ports也有http://cn.ports.ubuntu.com/ 的源。树莓派镜像里没有桌面环境,安装后没有本地化引导应该不会加cn。
sed -i 's|\(cn.\)\?ports.ubuntu.com|mirror.sjtu.edu.cn|g' /etc/apt/sources.list
可选cn就行了(按理说在基本正则里.是通配符,好多人都没打转义符直接用,我也懒得打了)
mirror-help: add ubuntu-ports.md