Ubuntu服务器中Unattended-upgrades配置ZeroTier源规则失败的问题求助
Ubuntu服务器中Unattended-upgrades配置ZeroTier源规则失败的问题求助
最近在搭建Ubuntu服务器的时候,我像往常一样安装了ZeroTier,同时配置了unattended-upgrades自动升级工具。但ZeroTier在自动升级这块一直是个麻烦家伙——它的源信息里全是重复的发行版名称,我查到的源详情如下:
500 http://download.zerotier.com/debian/mantic mantic/main amd64 Packages release o=mantic mantic,a=mantic,n=mantic,l=mantic mantic,c=main,b=amd64 origin download.zerotier.com Origin: mantic mantic Label: mantic mantic Suite: mantic Codename: mantic Date: Mon, 30 Oct 2023 18:45:47 UTC Architectures: amd64 arm64 armhf i386 ppc64el s390x Components: main Description: Generated by aptly
这些信息显然没什么实际参考价值。之前在所有Debian机器上,我在50unattended-upgrades配置文件里用下面这条规则一直都能正常工作:
"site=download.zerotier.com,n=${distro_codename}";
虽然这条规则不算完美,但至少能让ZeroTier的包正常自动升级。可到了这台Ubuntu服务器上,这条规则直接导致unattended-upgrades崩溃,报错信息如下:
Traceback (most recent call last): File "/usr/bin/unattended-upgrades", line 2522, in <module> sys.exit(main(options)) ^^^^^^^^^^^^^ File "/usr/bin/unattended-upgrades", line 1993, in main res = run(options, rootdir, mem_log, logfile_dpkg, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/bin/unattended-upgrades", line 2134, in run cache = UnattendedUpgradesCache(rootdir=rootdir) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/bin/unattended-upgrades", line 156, in __init__ self.allowed_origins = get_allowed_origins() ^^^^^^^^^^^^^^^^^^^^^ File "/usr/bin/unattended-upgrades", line 793, in get_allowed_origins allowed_origins = get_allowed_origins_legacy() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/bin/unattended-upgrades", line 772, in get_allowed_origins_legacy (distro_id, distro_codename) = s.split() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: not enough values to unpack (expected 2, got 1)
这真的让我很意外,我完全没想到Ubuntu和Debian的unattended-upgrades差异会这么大,居然会因为这条规则直接报错。后来我把这条源规则注释掉之后,unattended-upgrades就又能正常运行了,所以问题肯定出在这条规则上。
想请教各位,结合我上面给出的ZeroTier源信息,有没有什么办法能解决这个规则失效的问题?
备注:内容来源于stack exchange,提问作者Decoherent
相关产品推荐
相关产品推荐

