在Termux中使用proot-distro换源主要包括修改Termux自身的软件源和修改proot环境内Linux发行版的软件源两个步骤。

修改Termux软件源

打开Termux,输入以下命令启动源选择界面:

termux-change-repo

使用方向键选择Mirrorgroup,然后选择Mirrors in Chinese Mainland(如清华或中科大镜像),回车确认。

更新软件包列表:

pkg update -y

修改proot环境内的Linux发行版源(以Ubuntu为例)

进入proot环境:

proot-distro login ubuntu

备份原有源文件:

cp /etc/apt/sources.list /etc/apt/sources.list.bak

清空并替换为国内镜像源(以清华源为例):

  • 编辑sources.list文件:

    nano /etc/apt/sources.list
  • 清空内容后粘贴以下配置(适用于Ubuntu 24.04 Noble):

    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ noble main restricted universe multiverse
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ noble-updates main restricted universe multiverse
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ noble-backports main restricted universe multiverse
    deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ noble-security main restricted universe multiverse
  • 保存退出后更新软件包列表:

    apt update

文章作者: 神仙打架
本文链接:
版权声明: 本站所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 神仙打架
应用软件 Termux proot-distro
喜欢就支持一下吧