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
Open
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions content/post/mirror-help/ubuntu-ports.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
+++
title = "ubuntu-ports"
tags = ["mirror-help"]
author = "LengmoAngel"
+++

Ubuntu 是一个基于 Debian 的 Linux 发行版,包含了常用的大量软件包。Ubuntu 的目标在于为一般用户提供一个最新同时又相当稳定,主要以自由软件建构而成的作业系统。Ubuntu 目前具有庞大的社群力量支持,用户可以方便地从社群获得帮助。

本镜像收录 arm64, armhf, PowerPC, ppc64el, s390x 等结构的软件。

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