Skip to content

Conversation

@bananaxiao2333
Copy link

@bananaxiao2333 bananaxiao2333 commented Nov 22, 2025

本PR解决了大陆地区下载PDubuntu的tarball过慢的问题

修改:并将由原来的第三方PPA安装改为从miniconda安装python(自#86

Summary by Sourcery

改进 AstrBot 的 Termux 部署文档,以更好地支持 Python 3.10 的安装,并优化中国大陆地区的下载体验。

Documentation:

  • 记录一个备用的 proot-distro tarball 镜像及其校验和,加快中国大陆地区下载 Ubuntu 镜像的速度。
  • 使用基于 Miniconda 的安装脚本(采用清华镜像)替换之前基于 PPA 的 Python 3.10 安装步骤,并补充说明如有需要可切换到官方 Anaconda 仓库。
Original summary in English

Summary by Sourcery

Improve Termux deployment docs for AstrBot to better support Python 3.10 installation and downloads in mainland China.

Documentation:

  • Document an alternative proot-distro tarball mirror and checksum to speed up Ubuntu image downloads in mainland China.
  • Replace the previous PPA-based Python 3.10 installation steps with a Miniconda-based install script using Tsinghua mirrors, including a note on switching to the official Anaconda repo if needed.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

你好,我已经审查了你的更改,这里是一些反馈:

  • 推荐的 PD_OVERRIDE_TARBALL_URL/PD_OVERRIDE_TARBALL_SHA256 值是写死到某个特定的 proot-distro 版本上的,建议添加说明或机制,在未来 proot-distro 更新时保持这些值同步,以避免用户遇到 404 或校验和不匹配的问题。
  • 在 install-py310.sh 代码片段中,建议增加一些基础的健壮性处理(例如使用 set -e、检查 wget 是否成功、清理已下载的安装程序,以及为 $miniconda_version 等变量加上引号),以减少出现部分安装或损坏安装的可能性。
给 AI Agent 的提示
请根据这次代码审查中的评论进行修改:

## 总体评论
- 推荐的 PD_OVERRIDE_TARBALL_URL/PD_OVERRIDE_TARBALL_SHA256 值是写死到某个特定的 proot-distro 版本上的,建议添加说明或机制,在未来 proot-distro 更新时保持这些值同步,以避免用户遇到 404 或校验和不匹配的问题。
- 在 install-py310.sh 代码片段中,建议增加一些基础的健壮性处理(例如使用 `set -e`、检查 `wget` 是否成功、清理已下载的安装程序,以及为 `$miniconda_version` 等变量加上引号),以减少出现部分安装或损坏安装的可能性。

## 单条评论

### 评论 1
<location> `zh/deploy/astrbot/termux.md:98` </location>
<code_context>
+> `https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/`替换为`https://repo.anaconda.com/miniconda/`

-<!--这里如果安装 miniconda 或者 anaconda 都会有报错,不知道为什么-->
+全部复制以下语句中运行

+<!-- 这里优化了大陆网络环境,修复了miniconda报错问题 -->
</code_context>

<issue_to_address>
**suggestion (typo):** 这句话语序略显别扭,建议去掉“中”或补充连接词

可以改为“全部复制以下语句后运行”或“全部复制以下语句并运行”,这样读起来更自然也更清楚。

```suggestion
全部复制以下语句后运行
```
</issue_to_address>

### 评论 2
<location> `zh/deploy/astrbot/termux.md:100` </location>
<code_context>
-<!--这里如果安装 miniconda 或者 anaconda 都会有报错,不知道为什么-->
+全部复制以下语句中运行

+<!-- 这里优化了大陆网络环境,修复了miniconda报错问题 -->
 ```bash
-apt update && apt install software-properties-common
</code_context>

<issue_to_address>
**nitpick (typo):** “miniconda”建议改为首字母大写的“Miniconda”

这样可与官方命名保持一致,并提升文档中工具名称的一致性。

```suggestion
<!-- 这里优化了大陆网络环境,修复了 Miniconda 报错问题 -->
```
</issue_to_address>

Sourcery 对开源项目免费——如果你觉得这次评审有帮助,欢迎分享给更多人 ✨
帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进后续的代码审查。
Original comment in English

Hey there - I've reviewed your changes - here's some feedback:

  • The recommended PD_OVERRIDE_TARBALL_URL/PD_OVERRIDE_TARBALL_SHA256 values are hardcoded to a specific proot-distro release, so consider adding a note or mechanism to keep these in sync with future proot-distro updates to avoid users hitting 404s or mismatched checksums.
  • In the install-py310.sh snippet, consider adding basic robustness (e.g., set -e, checking that wget succeeds, cleaning up the downloaded installer, and quoting variables like $miniconda_version) to reduce the chance of partial or broken installations.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The recommended PD_OVERRIDE_TARBALL_URL/PD_OVERRIDE_TARBALL_SHA256 values are hardcoded to a specific proot-distro release, so consider adding a note or mechanism to keep these in sync with future proot-distro updates to avoid users hitting 404s or mismatched checksums.
- In the install-py310.sh snippet, consider adding basic robustness (e.g., `set -e`, checking that `wget` succeeds, cleaning up the downloaded installer, and quoting variables like `$miniconda_version`) to reduce the chance of partial or broken installations.

## Individual Comments

### Comment 1
<location> `zh/deploy/astrbot/termux.md:98` </location>
<code_context>
+> `https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/`替换为`https://repo.anaconda.com/miniconda/`

-<!--这里如果安装 miniconda 或者 anaconda 都会有报错,不知道为什么-->
+全部复制以下语句中运行

+<!-- 这里优化了大陆网络环境,修复了miniconda报错问题 -->
</code_context>

<issue_to_address>
**suggestion (typo):** 这句话语序略显别扭,建议去掉“中”或补充连接词

可以改为“全部复制以下语句后运行”或“全部复制以下语句并运行”,这样读起来更自然也更清楚。

```suggestion
全部复制以下语句后运行
```
</issue_to_address>

### Comment 2
<location> `zh/deploy/astrbot/termux.md:100` </location>
<code_context>
-<!--这里如果安装 miniconda 或者 anaconda 都会有报错,不知道为什么-->
+全部复制以下语句中运行

+<!-- 这里优化了大陆网络环境,修复了miniconda报错问题 -->
 ```bash
-apt update && apt install software-properties-common
</code_context>

<issue_to_address>
**nitpick (typo):** “miniconda”建议改为首字母大写的“Miniconda”

这样可与官方命名保持一致,并提升文档中工具名称的一致性。

```suggestion
<!-- 这里优化了大陆网络环境,修复了 Miniconda 报错问题 -->
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

bananaxiao2333 and others added 2 commits November 23, 2025 00:34
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
@bananaxiao2333 bananaxiao2333 changed the title 提供优化proot-distro下载速度备选方案 提供优化proot-distro下载速度备选方案与python安装方式修正 Nov 22, 2025
Comment on lines 67 to 77
>[!TIP]
>中国大陆概率访问`GitHub`,故建议使用加速器或代理
>
>或者也可以执行这两条指令来使用镜像
>```bash
>export PD_OVERRIDE_TARBALL_URL=https://ghfast.top/github.com/termux/proot-distro/releases/download/v4.30.1/ubuntu-questing-aarch64-pd-v4.30.1.tar.xz
>export PD_OVERRIDE_TARBALL_SHA256=5ab35b90cd9a9f180656261ba400a135c4c01c2da4b74522118342f985c2d328
>```
```bash
proot-distro install ubuntu
Copy link
Contributor

Choose a reason for hiding this comment

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

这里应该先写正常情况,然后再是什么加速的什么的

Copy link
Author

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.

。。。

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.

3 participants