You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 命令执行失败,退出状态: 25600chsrc: 关键错误,强制结束root@debian:~#
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:~#
Activity
ccmywish commentedon Mar 23, 2025
了解你的需求,不存在 curl,只有 wget。这涉及到两个环节:
分别采用两种解决方法:
chsrc set debian tuna直接换到清华源,或者set first换到维护团队测速的最快源第二步可以避开测速过程,因而避开了使用 curl。
kekylin commentedon Mar 23, 2025
安装使用chsrc需要经过三个步骤:
1、下载安装脚本【已解决】
可通过wget工具下载。
wget https://chsrc.run/posix | bash2、安装chsrc【未解决】
因为系统没有curl工具,实际上第一步操作执行后,只能完成安装脚本文件的下载,无法正常运行脚本并完成chsrc的安装。
疑似安装过程需要使用到curl工具。
3、使用chsrc【已解决】
直接使用
chsrc set debian tuna直接换到清华源,或者set first换到维护团队测速的最快源,避开curl测速。4、手动下载二进制文件安装【安装成功,换源报错】
通过手动下载二进制文件安装,也未成功换源,操作流程如下。
手动下载安装:
执行换源:
期望是能直接通过脚本完成安装,而不是手动安装模式,谢谢!
ccmywish commentedon Mar 23, 2025
没注意到这个依赖项。是这样的。如果你有兴趣,可以参与贡献,帮助修改安装脚本
https://github.com/RubyMetric/chsrc/blob/main/tool/installer.sh#L242
我们在 Debian 的换源recipe中好像没有处理过这种情况。你可否复制粘贴现在的
/etc/apt/sources.list让我们看下?另外你可以试试 https://github.com/SuperManito/LinuxMirrors 这个项目帮助解决燃眉之急
kekylin commentedon Mar 23, 2025
抱歉哈,目前能力无法做出贡献。我不太懂编程,只是有这个业余爱好。
在玩NAS过程中偶然发现这个项目,想搭个换源便车,不是刚需,大佬方便就整上。
手动换源是熟悉的,只是发现这个项目在具备基础条件下,换源更加方便快速。
/etc/apt/sources.list文件内容如下:
happy-game commentedon Mar 24, 2025
可以判断系统中存在
curl和wget来决定使用哪个。这个需求感觉不是很急迫,要不新建一个
good first issue给想参与贡献的用户。Handle `Debian` CDROM case
Use 'old source list' macro
Fallback to `wget`
ccmywish commentedon Mar 25, 2025
@happy-game 没事,这个是小问题,刚好我要手动合并现有的那个修改installer.sh的PR。现在已经修改好了
ccmywish commentedon Apr 13, 2025
@kekylin
已修复。现在的方式是:
chsrc检查你的源配置文件,如果是像你所装系统这样的,用 cdrom 的,将会删除这个配置文件,重新给你生成一个新的源配置文件。可试用最新版
v0.2.1。kekylin commentedon Apr 13, 2025
非常感谢!通过Debian系统测试,已达到预期需求。