-
-
Notifications
You must be signed in to change notification settings - Fork 210
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
功能请求:增加初始无软件源系统换源功能 #185
Comments
了解你的需求,不存在 curl,只有 wget。这涉及到两个环节:
分别采用两种解决方法:
第二步可以避开测速过程,因而避开了使用 curl。 |
安装使用chsrc需要经过三个步骤: 2、安装chsrc【未解决】 3、使用chsrc【已解决】 4、手动下载二进制文件安装【安装成功,换源报错】 root@debian:~# wget https://gitee.com/RubyMetric/chsrc/releases/download/pre/chsrc-x64-linux -O chsrc && \
chmod +x chsrc && \
./chsrc
--2025-03-23 15:03:30-- https://gitee.com/RubyMetric/chsrc/releases/download/pre/chsrc-x64-linux
Resolving gitee.com (gitee.com)... 180.76.198.225, 180.76.198.77, 180.76.199.13
Connecting to gitee.com (gitee.com)|180.76.198.225|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://gitee.com/RubyMetric/chsrc/attach_files/2096424/download/chsrc-x64-linux [following]
--2025-03-23 15:03:31-- https://gitee.com/RubyMetric/chsrc/attach_files/2096424/download/chsrc-x64-linux
Reusing existing connection to gitee.com:443.
HTTP request sent, awaiting response... 302 Found
Location: https://foruda.gitee.com/attach_file/1742194070384800506/chsrc-x64-linux.bin?token=36fabcf4aba2bfecbf7ebdfaa026e176&ts=1742713411&attname=chsrc-x64-linux [following]
--2025-03-23 15:03:31-- https://foruda.gitee.com/attach_file/1742194070384800506/chsrc-x64-linux.bin?token=36fabcf4aba2bfecbf7ebdfaa026e176&ts=1742713411&attname=chsrc-x64-linux
Resolving foruda.gitee.com (foruda.gitee.com)... 180.76.198.77, 180.76.199.13
Connecting to foruda.gitee.com (foruda.gitee.com)|180.76.198.77|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1078088 (1.0M) [application/x-executable]
Saving to: ‘chsrc’
chsrc 100%[========================================>] 1.03M 553KB/s in 1.9s
2025-03-23 15:03:33 (553 KB/s) - ‘chsrc’ saved [1078088/1078088]
chsrc: Change Source (GPLv3+) v0.2.0.1-2025/03/17 by RubyMetric
使用: chsrc <command> [options] [target] [mirror]
help 打印此帮助,或 h, -h, --help
issue 查看相关issue
list (或 ls, 或 l) 列出可用镜像源,和可换源目标
list mirror/target 列出可用镜像源,或可换源目标
list os/lang/ware 列出可换源的操作系统/编程语言/软件
measure <target> 对该目标所有源测速
cesu <target>
list <target> 查看该目标可用源与支持功能
get <target> 查看该目标当前源的使用情况
set <target> 换源,自动测速后挑选最快源
set <target> first 换源,使用维护团队测速第一的源
set <target> <mirror> 换源,指定使用某镜像站 (通过list <target>查看)
set <target> https://url 换源,用户自定义源URL
reset <target> 重置,使用上游默认使用的源
选项:
-dry Dry Run,模拟换源过程,命令仅打印并不运行
-local 仅对本项目而非全局换源 (通过ls <target>查看支持情况)
-ipv6 使用IPv6测速
-en(glish) 使用英文输出
-no-color 无颜色输出
镜像站状态: <https://github.com/RubyMetric/chsrc/wiki>
维护: <https://github.com/RubyMetric/chsrc>
执行换源: root@debian:~# ./chsrc set debian tuna
[chsrc 检查] x 文件 /etc/apt/sources.list.d/debian.sources 不存在
[chsrc 检查] ✓ 文件 /etc/apt/sources.list 存在
选中镜像站: TUNA (tuna)
--------------------------------
[chsrc 提示] 如果遇到无法拉取 HTTPS 源的情况,我们会使用 HTTP 源并需要您运行:
apt install apt-transport-https ca-certificates
[chsrc 备份] /etc/apt/sources.list -> /etc/apt/sources.list.bak
[chsrc 运行] sed -E -i 's@https?://.*/debian/?@https://mirrors.tuna.tsinghua.edu.cn/debian@g' /etc/apt/sources.list
[chsrc 运行] ✓ 命令执行成功
[chsrc 运行] apt update
Ign:1 cdrom://[Debian GNU/Linux 12.9.0 _Bookworm_ - Official amd64 DVD Binary-1 with firmware 20250111-10:55] bookworm InRelease
Err:2 cdrom://[Debian GNU/Linux 12.9.0 _Bookworm_ - Official amd64 DVD Binary-1 with firmware 20250111-10:55] bookworm Release
Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs
Reading package lists... Done
E: The repository 'cdrom://[Debian GNU/Linux 12.9.0 _Bookworm_ - Official amd64 DVD Binary-1 with firmware 20250111-10:55] bookworm Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
[chsrc 运行] x 命令执行失败,退出状态: 25600
chsrc: 关键错误,强制结束
root@debian:~# 期望是能直接通过脚本完成安装,而不是手动安装模式,谢谢! |
没注意到这个依赖项。是这样的。如果你有兴趣,可以参与贡献,帮助修改安装脚本 https://github.com/RubyMetric/chsrc/blob/main/tool/installer.sh#L242
我们在 Debian 的换源recipe中好像没有处理过这种情况。你可否复制粘贴现在的 另外你可以试试 https://github.com/SuperManito/LinuxMirrors 这个项目帮助解决燃眉之急 |
抱歉哈,目前能力无法做出贡献。我不太懂编程,只是有这个业余爱好。 /etc/apt/sources.list文件内容如下: root@debian:~# cat /etc/apt/sources.list
deb cdrom:[Debian GNU/Linux 12.9.0 _Bookworm_ - Official amd64 DVD Binary-1 with firmware 20250111-10:55]/ bookworm contrib main non-free-firmware
root@debian:~#
|
可以判断系统中存在 这个需求感觉不是很急迫,要不新建一个 |
@happy-game 没事,这个是小问题,刚好我要手动合并现有的那个修改installer.sh的PR。现在已经修改好了 |
原因:
因Debian安装系统过程中安全源更新在国内速度异常缓慢,一般情况下我采用完整镜像包用离线模式安装系统。
系统安装完成后,默认是无软件源的。也因为是最小化安装,系统初始环境无curl工具,只有wget工具。
无软件源+无curl工具,导致无法正常使用chsrc,无法享受换源的便利性。
期望:
如果可以,请求增加初始无软件源系统换源功能,谢谢!
The text was updated successfully, but these errors were encountered: