Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mirror-help: add ubuntu-ports.md #86

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

LengmoAngel
Copy link
Contributor

mirror-help: add ubuntu-ports.md

mirror-help: add ubuntu-ports.md
content/post/mirror-help/ubuntu-ports.md Outdated Show resolved Hide resolved
content/post/mirror-help/ubuntu-ports.md Outdated Show resolved Hide resolved
LengmoAngel and others added 2 commits August 25, 2021 16:27
Co-authored-by: Alex Chi <iskyzh@gmail.com>
Co-authored-by: Alex Chi <iskyzh@gmail.com>
Copy link
Member

@skyzh skyzh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

一般在这里还需要添加用户配置方法。参考一下 debian.md?

mirror-help:update ubuntu-ports.md
Copy link
Member

@skyzh skyzh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

顺便一提,这个一键替换指令在你的机器上可以用吗?帮忙测试一下?


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

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
您也可使用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` 指令直接批量修改

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

测试了,是可以的,不是 arm 环境是 x86 环境。我觉得硬替换应该没问题吧

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

印象里 ubuntu-ports 的默认源是不带 cn 的,还是要之后确认一下。这个 PR 暂且搁置。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我也没有类似的设备 暂且搁置吧

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

虽然我觉得可以做一个类似于这个https://github.com/tuna/oh-my-tuna 虽然是愚人节玩笑

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

暂时没有精力维护更多项目 😂 😂 😂

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

印象里 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 进行一键替换。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

争取过几天去真机 例如树莓派 nVidia开发板上面跑跑看

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

其实 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就行了(按理说在基本正则里.是通配符,好多人都没打转义符直接用,我也懒得打了)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants